-->
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: components and generated finder methods
PostPosted: Fri Feb 11, 2005 5:20 am 
Newbie

Joined: Sun Feb 06, 2005 11:46 am
Posts: 4
Location: Rotterdam, Netherlands
Hello, I want to create a finder for a component, as this:

Code:
<component name="versionNumber" class="nl.....VersionNumber">
<property name="major" column="MAJOR_NR" type="java.lang.Integer" not-null="true"/>
<property name="minor" column="MINOR_NR" type="java.lang.Integer" not-null="true"/>
<meta attribute="finder-method">findByVersionNumber</meta>
</component>


When I generate the .java classes, including the finder, I get this:

Code:
public static List findByVersionNumber(Integer major) throws HibernateException {
    Session session = HibernateSessionFilter.getSession();
    List finds = session.find("from nl.....VersionNumber as versionNumber where versionNumber.major=?", major, Hibernate.INTEGER);
    return finds;
}

public static List findByVersionNumber(Integer minor) throws HibernateException {
    Session session = HibernateSessionFilter.getSession();
    List finds = session.find("from nl......VersionNumber as versionNumber where versionNumber.minor=?", minor, Hibernate.INTEGER);
    return finds;
}


Naturally this is not what I want. At first it won't compile, because it's basically the same method implemented twice. Moreover I want to find all Versions by their (combined) VersionNumber, not by major or minor number. Can anybody tell me how I can get this generated, as opposed to building it myself?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 11, 2005 6:00 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
looks like a bug in the Finder renderer.

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