-
1. Re: ORM.xml Sample
wolfgangknauf Dec 30, 2006 10:04 AM (in response to david.l.small)Hi Dave,
I have some, but the samples are in german. I will link you directly to the ear files containing the orm.xml:
Single Entity bean:
http://www.informatik.fh-wiesbaden.de/~knauf/SWTVertiefung2006/kuchen/KuchenSimpleNoAnnotation.ear
Two entity beans with a one-to-many relation
http://www.informatik.fh-wiesbaden.de/~knauf/SWTVertiefung2006/kuchenzutat/KuchenZutatNoAnnotation.ear
Two entity beans with a many-to-many relation
http://www.informatik.fh-wiesbaden.de/~knauf/SWTVertiefung2006/kuchenzutatnm/KuchenZutatNMNoAnnotation.ear
Hope this helps
Wolfgang -
2. Re: ORM.xml Sample
david.l.small Jan 3, 2007 8:05 PM (in response to david.l.small)Thanks, Wolfgang, this was very helpful. I'm still having trouble trying to mix annotations and XML. My classes are all annotated with table/column specific information and my ORM.xml file contains my named queries. Unfortunately, it doesn't seem able to compile the named queries unless the table/column information is also contained within the ORM file.
Any help would be appreciated. Otherwise, Wolfgang, thanks for your previous post.
Dave -
3. Re: ORM.xml Sample
wolfgangknauf Jan 4, 2007 10:46 AM (in response to david.l.small)Hi Dave,
if you mix up annotations and xml, you should not add the attributemetadata-complete="true"
to the entities in orm.xml.
Hope this helps, if not I cannot help you further because I did not mix annotations and xml up to now.
Best regards
Wolfgang -
4. Re: ORM.xml Sample
david.l.small Jan 4, 2007 1:02 PM (in response to david.l.small)Thanks for the follow-up, Wolfgang. Actually, I tried multiple options. First I completely excluded the entity elements. Then, I explicitly set the metadata-complete to false. When I looked further I discovered that the error wasn't explicitly with the EAR that contained the ORM.xml file. My other projects (different EARs) with their own EJB projects were failing to start with errors pointing back to the single query in my ORM.xml.
As it turns out if, my other EJB projects were picking up the ORM.xml in the first project. The fix: put an empy ORM.xml file in the other EJB projects. I was running for the longest time without any ORM.xml files in any of my projects and having no problems. Once I included an ORM.xml file in one of my projects, all the other ones that tried to start after that project failed unless they contained an empty ORM.xml file. It seems a bit odd, but it now works.
I hope this makes sense.
The upshot is that you can have an ORM.xml with no "entity" elements and only queries and it seems to work just fine.
Thanks for your help. -
5. Re: ORM.xml Sample
wolfgangknauf Jan 8, 2007 4:59 AM (in response to david.l.small)Hi David,
this sounds like a bug if orm.xml is picked across EARs.
Maybe you should file it.
Wolfgang