Anything you could map with TopLink you should be able to map with
EclipseLink although some mappings may exceed the JPA 1.0 specification. I
am not sure exactly how you want to map this so if you could provide more
details I am sure we can help.
Thanks Doug. Basically I'm trying to do "Direct Collection" mapping. I
know can do this with EclipseLink but I'm having a hard time trying to do
this with JPA. What do I do in orm.xml?
Here is the data model:
Profile
--------
id
username,
gender
profile_status_id
...
Profile Status
-------------
id,
name
So on the object side, I don't want to have to create profile Status
object.
My object would look like:
Profile {
int id;
string userName;
string profileStatus;
}
How do I accomplish this with JPA? Is there way to leverage non supported
jpa mapping? If so I'd love to learn about it
EclipseLink offers @BasicCollection and @BasicMap annotations to configure
these mappings. They are not part of the JPA 1.0 spec (JPA 2.0 will
support this type of mapping).
If you want configure these advanced mappings in XML you can use an
eclipselink-orm.xml file (instead of the JPA standard one) and leverage
these advanced mappings as well. In the following example the Employee
class uses a BasicCollection mapping.
Thanks Doug. On another note, In Eclipselink 1.0.1 for JPA. Does the
annotation work? I have to use the orm.xml, every time I put annotation
in the code it doesn't seem to work but it works fine with orm.xml? Is
there another setting to say use annotation instead of xml (like in spring
framework)?
I use annotations all the time and have also been mixing in orm.xml and
eclipselink-orm.xml to override the annotations. Is there any chance you
have configured your orm.xml to be metadata complete?
Does it ignore the annotations when you have no orm.xml at all?