-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate mapping question
PostPosted: Mon Apr 03, 2006 4:45 pm 
Newbie

Joined: Mon Apr 03, 2006 4:27 pm
Posts: 1
Hibernate version: 3.1

Mapping documents: N/A

Code between sessionFactory.openSession() and session.close(): N/A

Full stack trace of any exception that occurs: N/A

Name and version of the database you are using: Oracle 9.2.0.6

The generated SQL (show_sql=true): N/A

Debug level Hibernate log excerpt: N/A


I have a Hibernate Best Practices question.

We have two tables in our application, where the first table contains a group code and serves as a parent with a one-to-many relationship to a child table that contains type codes. So it is one group code to many type codes. Throughout the application, the group and type codes are used as attributes of other domain objects. For e.g, we may have a Brand object which has a manufacturer type code as an attribute. We have separate classes for the two tables and Hibernate mappings for each.

My question is if it possible to have Hibernate mappings with a permanent filter based on the group code, for each object that needs a separate class. For e.g. if the manufacturer type code above needs to have its own class instead of coming from the generic type code class, can we have a Hibernate mapping that maps to the manufacturer code class with a filter indicating that the group code is always the Manufacturer group code?

We are told by our Architecture group that this type of mapping is "fragile" and they prefer to have a separate table and mapping for each type code, instead of trying to re-use the common set of tables. What exactly do they mean by "fragile" and what are the pros and cons of doing such a mapping?

Would appreciate any speedy replies. Thanks in advance.


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

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.