-->
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.  [ 6 posts ] 
Author Message
 Post subject: EJB3 Entity Generation using hibernate tools
PostPosted: Fri Jul 21, 2006 8:29 am 
Newbie

Joined: Tue Dec 06, 2005 8:47 am
Posts: 16
Location: London
I am the Hibernate Code Generation tools to generate my entity from a reveng.xml file. Is there any way of changing the annotions from method access to property access.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 21, 2006 9:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
eh you mean field access ?

yes - change the templates.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 21, 2006 9:16 am 
Newbie

Joined: Tue Dec 06, 2005 8:47 am
Posts: 16
Location: London
yes field access. I have had a look at the templates and was confused. I know i should be reading the documentation on freemarker. I tried to change it with the following

I changed the PojoFields.ftl to

// Fields

<#foreach field in pojo.getAllPropertiesIterator()><#if pojo.getMetaAttribAsBool(field, "gen-property", true)> <#if pojo.hasMetaAttribute(field, "field-description")> /**
${pojo.getFieldJavaDoc(field, 0)}
*/
</#if> <#include "Ejb3PropertyGetAnnotation.ftl"/> ${pojo.getFieldModifiers(field)} ${pojo.getJavaTypeName(field, jdk5)} ${field.name}<#if pojo.hasFieldInitializor(field, jdk5)> = ${pojo.getFieldInitialization(field, jdk5)}</#if>;
</#if>
</#foreach>

and commented out
<#include "Ejb3PropertyGetAnnotation.ftl"/>
in the PojoPropertyAccessors.ftl

Would this be the correct place to start.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 21, 2006 10:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 21, 2006 10:53 am 
Newbie

Joined: Tue Dec 06, 2005 8:47 am
Posts: 16
Location: London
Ok will try to work through this. Can you tell me if you have the settings for generating the sequence generator for the EJB3 entity beans by using the table name as the sequence name.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 21, 2006 10:57 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i don't understand ?

are you asking if we have some direct settings support for choosing the generator strategy and its parameters ? Then kind-of ;)

reveng.xml allows you to enter it manually per table

Writing a custom ReverseEngineeringStrategy allows you to control it automatically. Look at implementing:

public String getTableIdentifierStrategyName(TableIdentifier identifier);

public Properties getTableIdentifierProperties(TableIdentifier identifier);

_________________
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.  [ 6 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.