-->
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: Base / Subclass architecture for POJO generation
PostPosted: Wed Apr 08, 2009 6:25 pm 
Newbie

Joined: Wed Mar 11, 2009 1:04 pm
Posts: 9
Hi all,

i'm coming from the php world where i used to work with the 'doctrine' orm framework. This framework had some scripts to generate php classes from your mapping files, but with a a Base/Subclass architecture.

Let's say you have a 'User' entity and you generate the php code for the first time, the script creates a BaseUser class, and a User class which simply extends BaseUser, whithout adding anything.

If the User file already exists, it won't touch it anymore, with the benefit that you can add your own code to the POJO that will not be overwritten when the code generation script runs. After looking at the docs, the only way one could implement something like this is with custom hbmtemplates for hibernate ant task.

Does anyone know if this is possible somehow?


Top
 Profile  
 
 Post subject: Re: Base / Subclass architecture for POJO generation
PostPosted: Tue May 05, 2009 7:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
add a <meta attribute="generated-class" value="BaseUser"/> in your User mappings.

_________________
Max
Don't forget to rate


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.