Problem:
In my table Log I have a reference at "system bytea" in place of a
"log_systemid varchar(15)" + "CONSTRAINT xxxx FOREIGN KEY ...".
I do not understand why hibernate do not create the CONSTRAINT !? It works well
with other classes without a Pk class (multiple primary keys).
Please help...
Environment:
JBoss 4.0.3
JBoss EJB 3.0 RC3
Postgresql 8.0
Java code:
@Embeddable(access = AccessType.FIELD)
public class LogPk implements Serializable{
private System system;
private String type;
private Timestamp startTime;
...
}
@Entity
@IdClass(LogPk.class)
public class Log implements Serializable {
...
@ManyToOne
@JoinColumn(name = "systemPk", insertable = false, updatable = false)
public System getSystem() {
return system;
}
...
}
SQL result:
CREATE TABLE system
(
systemid varchar(15) NOT NULL,
timezone varchar(31),
CONSTRAINT system_pkey PRIMARY KEY (systemid)
)
CREATE TABLE log
(
"type" varchar(255) NOT NULL,
starttime timestamp NOT NULL,
system bytea NOT NULL,
doc text,
endtime timestamp,
CONSTRAINT log_pkey PRIMARY KEY ("type", starttime, system)
)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3916928#3916928
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3916928
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user