persistence@glassfish.java.net

RE: Re: Code changes relevant to Issue 272 : java2db support for UniqueConstraint

From: Gordon Yorke <gordon.yorke_at_oracle.com>
Date: Thu, 16 Mar 2006 16:02:12 -0500

Looks great Pramod,
Please check it in.
--Gordon

-----Original Message-----
From: Pramod Gopinath [mailto:Pramod.Gopinath_at_Sun.COM]
Sent: Wednesday, March 15, 2006 10:48 PM
To: Gordon Yorke
Cc: Tom Ware; persistence_at_glassfish.dev.java.net
Subject: Re: Code changes relevant to Issue 272 : java2db support for
UniqueConstraint


Hi Gordon
  Here are the latest files to address this issue. The following files
had to changed compared to what was sent out earlier.
1.EntityMappingsXMLProcessor.java :
   Using the file that you had sent earlier. I had to change the
getUniqueConstraint(), to ensure that we create a String[] of column
names for each UniqueConstraint defined on the table.
  This would make the behavior consistent with what was happening in
EJBAnnotationsProcessor.
  After making this change had to make changes to
processUniqueConstraints() to get the String[] and assign it to the
DatabaseTable.

2. Had to make some more changes to TableDefinition to ensure that I
was creating and dropping the unique constraints directly from the
database connection, if that option is used.

3. Have the changed SequenceProcessor.java that you had provided earlier.

Additionally I changed the entity-persistence-tests and added
uniqueConstraint to CMP3_BUYER. This way this feature would be tested
when the tests are run.

Thanks
Pramod

Gordon Yorke wrote:
> Hello Pramod,
> I really can't review these changes. You have missed updates to SequenceProcessor which I have attached here. Updating EntityMappingsXMLProcessor.java is going to require other classes to change unless you use the attached example and provide a DatabaseTable.addUniqueConstraint(String columnName).
> --Gordon