-->
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.  [ 3 posts ] 
Author Message
 Post subject: Reusable component definitions
PostPosted: Sat Oct 18, 2003 5:49 pm 
Newbie

Joined: Fri Oct 17, 2003 3:21 pm
Posts: 4
Hi,

While writing hbm files -

Component is only available inside a class, not as a hight level entity by itslef.

<!ELEMENT hibernate-mapping (meta*, import*, (class|subclass|joined-subclass)*, query*)>

Hence a component even though same, needs to be defined over and over again for each class.

It would be nice to define it once and then just use it in a class that requires that component.

For e.g. Address. Address component can have line1, line2, city, state, zip. Now if I changed zip to zip_main and zip_extension, then I have to change it in every table where Address is included.

It would be nice to just change the component and then automatically have all your tables changed to use the new definition of that component.

Another goog example is "who" and "when" columns. They can be defined as a component just once and then reused where it's needed. And if you decide to change the way componet works for e.g. use user id insted of username, you just change it once in the component and all your classes get that functionality.

Think "Database patterns".

What do you think about adding this functionality?

Thanks,
Prashant Rane


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 19, 2003 1:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Top level components were in Hibernate 1.x and dropped for hibernate 2.x . You can use a custom type instead.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 19, 2003 7:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
or you can use an XML external entity


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.