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

Key: EJB-32
Type: Improvement Improvement
Status: Reopened Reopened
Priority: Major Major
Assignee: Vance Karimi
Reporter: Torsten Lunze
Votes: (View)
Watchers: (View)
Operations

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

EJB3: EmbeddedValue: Generate Associations

Created: 20/Jun/06 01:25 PM   Updated: 28/Jun/06 08:51 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Environment: Andromda-3.2, EJB3


 Description   
A EmbeddedValue can have associations which should be generated to. For example you can have a Currency (defining Dollar, Euro ...) and CurrencyValue having a Currency and an amount. In CurrencyValue you would need the following:

@OneToOne
@JoinColumn(name="CURRENCY_CODE")
public Currency getCurrency() {
return currency;
}

(I think only unidirectional OneToOne association make sense here)

Then you also have to override the foreign key in the Entity you will embedded the currency value (<- I will provided a patch for this)

 All   Comments   Change History      Sort Order:
Comment by Vance Karimi [27/Jun/06 07:21 AM]
Done. Fix in CVS. Thanks Torsten :)

Comment by Vance Karimi [28/Jun/06 08:51 AM]
Need to add the association mutators to the base class.