> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of > M-Leander Reimer > Sent: 1. juli 2002 16:15 > To: [EMAIL PROTECTED] > Subject: [Middlegen-user] Clash with CMP and CMR fields in JBoss > > > Hi, > I came across a problem with Middlegen samples + JBoss 3.0.0 + mySQL and > I could need some advice. > > Basically, it is not allowed in JBoss to declare a CMR field also as a > CMP field. The Hypersonic DB in JBoss doens't complain, but mySQL does. > What happens is that the generated create table statement has a > duplicate column name for all foreign key fields. The solution to it is > (from JBoss forum) not to declare the foreign key fields as CMP. >
Can you point me to where/who said this? I don't think the EJB 2.0 mandates this, and I suspect this to be a JBoss limitation. > The question is: How do I change Middlegen appropriately? I changed the > Velocity template not to include the setter/getter methods (and the > ejb:persistent tag) for all foreign key columns. Is this OK that way?? > I have committed an update which makes it possible to turn off CMP generation for CMR fields: <cmp20 fkcmp="false"/> > Is it still possible to have a compound primary key (like it is in the > Reservation table) without declaring the CMP fields for the foreign > keys? > Unfortunately not. See section 10.8.2 third paragraph of the EJB 2.0 spec: "The names of the fields in the primary key class must be a subset of the names of the container-managed fields. (This allows the container to extract the primary key fields from an instance’s container-managed fields, and vice versa.)" > Thanks for your help! > > Leander > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > middlegen-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/middlegen-user ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ middlegen-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/middlegen-user