-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Component Mapping Problem
PostPosted: Fri Apr 25, 2008 10:55 am 
Beginner
Beginner

Joined: Thu Jun 29, 2006 8:41 am
Posts: 41
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.

_________________
Falci - Heavy Worker!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 27, 2008 3:17 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
Check this link for more details on component class
http://www.hibernate.org/hib_docs/reference/en/html/components.html

I have had same problem with sets. And the only solution is to make the property update="false" and insert="false" in places were duplicates occur. But another possible way is to remove the duplicate property if you do not want a direct access at all.

_________________
Sukirtha


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.