Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » embedded object: field does not exist(override field in the embedded object that does not exist on table)
embedded object: field does not exist [message #633924] Tue, 19 October 2010 17:52 Go to next message
Eclipse UserFriend
I created an Embedded object that I would like to reuse. The problem is that some of the fields in the embedded object are not always used.

For instance, I have an Address object that has addr1 and addr2 fields. There are some cases where I do not have an addr2 in the DB to map to (sometimes, I do!).

How do you get around this problem. Seems like it should be a simple override, but can't find info on it.

Thanks!
Re: embedded object: field does not exist [message #634443 is a reply to message #633924] Thu, 21 October 2010 13:54 Go to previous message
Eclipse UserFriend
You can't do this with overrides.

You can have two different Address classes, one for each type of Address. You could potentially use inheritance in the embeddable for this, JPA does not support inheritance in Embeddables, but EclipseLink does support inheritance in Embeddable (only at runtime currently, you would need to define the mappings in code).
Previous Topic:How to use static weaving properly ?
Next Topic:EclipseLink - SQL Server - Unicode?
Goto Forum:
  


Current Time: Tue Jul 22 23:46:28 EDT 2025

Powered by FUDForum. Page generated in 0.06201 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top