Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.1.3
Name and version of the database you are using: Oracle 9
Hi,
We have a particular data-base and we generate all mapping files to it, following this idea:
All the information exists in an Access file generated by someone else (not us) and we read it and create a data base.
From this base we read all the data and create POJOs with the necessary Xdoclet comments.
Then, we use a program that is basically a program version of the Ant script commonly used to generate HBM mappings to create them.
The final objective is to test the accuracy of the Access mapping to the Real Data Base.
The following mapping structure is creating problems for us:
Class A -> C1 -> C2
Class A -> C2
Where POJO Class A represents a table and has these two component classes C1 and C2 where C2 can be reached directly from Class A and from C1.
The one point in the process that brings us problems is when the Ant derivative program reads the POJOs and generates the mappings, it maps C2 and it's properties/colums twice.
Then, when running queries with hibernate, it crashes complaining that at least one of the duplicate mappings should be insert and update false.
Since we never write to the database, this should pose no problem. What we need to know is if this type of mapping is not recommended or undesirable or if there is another way around it.
In other words, We need to know as much as possible about this problem and possible solutions to present it to the guy behind the Access file and let him figure the best solution to the situation.