-->
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.  [ 5 posts ] 
Author Message
 Post subject: Basic Finder Generator : FinderRenderer : BasicRenderer
PostPosted: Tue Jun 01, 2004 6:16 pm 
Beginner
Beginner

Joined: Thu May 06, 2004 4:06 pm
Posts: 25
Hello,

I am using the hbm2java.BasicRenderer, and the hbm2java.FinderRenderer. Just wondering if there is a way to get the "finders" generated by the FinderRenderer, included in the java implementation from the BasicRenderer?

Or will they always be in seperate classes?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 01, 2004 6:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes! anything else is reaaaly bad style ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2004 11:51 am 
Beginner
Beginner

Joined: Thu May 06, 2004 4:06 pm
Posts: 25
Quote:
yes! anything else is reaaaly bad style ;)


Agreed! Now that it is possible, any clues on how to do it? My situation may be a little different:

I Generate my classes in a "base" directory:

Code:
<codegen>
  <generate package="com.xxx.db.base" renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer" />
</codegen>


And I have my own personal classes in com.xxx.db, which extends its corresponding class in com.xxx.db.base. So the class/hbm has the following:

Java Class:

Code:
package com.xxx.db;

public class ObjectA extends com.xxx.db.base.ObjectA
{


hbm:

Code:
<hibernate-mapping>
    <class name="com.xxx.db.ObjectA" table="table_a">


My problem, is when I use the BasicRenderer, it OVERWRITES my com.xxx.db.* files if i don't declare a suffix. And of course, if I declare a suffix, I don't get the finders in the files that the Basic Finder generates.

Any ideas?

Thanks

I am using : http://www.hibernate.org/hib_docs/reference/en/html/toolsetguide.html#toolsetguide-s2-3 as a reference.

In my config file for hbm2java, if I don't add a "suffix"


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2004 4:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
eh - i think you misunderstood me!

I answered yes to the fact they would always be separate files!
Having persistencerelated finders in your POJO's are baad style!

Why would you force references to session etc. in your POJO's ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2004 5:12 pm 
Beginner
Beginner

Joined: Thu May 06, 2004 4:06 pm
Posts: 25
Quote:
eh - i think you misunderstood me!


That I did. Didn't really think about referencing the session. Makes sense.

Thanks!


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