History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: EJB-94
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Vance Karimi
Reporter: Olivier THIERRY
Votes: (View)
Watchers: (View)
Operations

If you were logged in you would be able to see more operations.
EJB Cartridge

Implement uniqueGroup on entities in EJB3 cartridge

Created: 10/Oct/07 02:35 PM   Updated: 18/Apr/08 11:40 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File EJB3EntityFacadeLogicImpl.diff (3 kb)
2. Zip Archive EJB3MetafacadeModel.xml.zip (64 kb)
3. File Entity.vsl.diff (1 kb)
4. File EntityEmbeddable.vsl.diff (1 kb)
5. Zip Archive andromda-metafacades-uml.xml.zip (123 kb)
6. File emf.uml2.EntityAssociationEndLogicImpl.diff (1 kb)
7. File emf.uml2.EntityAttributeLogicImpl.diff (0.9 kb)
8. File uml14.EntityAssociationEndLogicImpl.diff (1 kb)
9. File uml14.EntityAttributeLogicImpl.diff (0.8 kb)

Environment: AndroMDA 3.3-SNAPSHOT + EJB3 cartridge


 Description   
AndroMDA profiles delivers a @andromda.persistence.column.uniqueGroup that should be used to define unique constraints in a table. But this tagged value is not taken in account by EJB3 cartridge.

In UML model you set the same value to this tagged value for columns you need to include in the unique constraint. These columns can be either entity attributes or association ends.

From this model, Hibernate cartridge generates a unique-key attribute in .hbm.xml file.
But it has to work a different way with EJB3 entities. The unique constraints have to be set within @Table annotation with uniqueConstraints attribute, which itself contains an array of @UniqueConstraint annotation.

See this post on the forum : http://galaxy.andromda.org/forum/viewtopic.php?t=5215

 All   Comments   Change History      Sort Order:
Comment by Olivier THIERRY [18/Apr/08 11:31 AM]
I made changes for this. I first had to change andromda metafacades because uniqueGroup was not token in account for entity association ends. Then I changed EJB3 metafacades and some templates. Everything is explained here : http://galaxy.andromda.org/forum/viewtopic.php?p=25455#25455

As attached files, you will find metafacades model for both andromda and EJB3 cartidge + java classes and templates. Note EJB3 Java classes and templates consider you have applied the dao / transformers patch before.