-->
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.  [ 1 post ] 
Author Message
 Post subject: Finder Methods not being generated for any attributes using
PostPosted: Mon Apr 11, 2005 4:12 pm 
Newbie

Joined: Mon Apr 11, 2005 3:41 pm
Posts: 5
Hello,

Great Product. I am using Hibernate version 2.1. I am using hbm2java to generate POJO's and Finder methods. Here is my class mapping document.

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin 2.1

http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->

<class
name="com.knight.model.Employee"
table="EMPLOYEE_MASTER"
schema="ENTSYS"
>

<meta attribute="session-method">HibernateUtil.getSession();</meta>

<id
name="empmastid"
type="long"
column="EMPMASTID"
>
<meta attribute="use-in-equals">true</meta>
<meta attribute="finder">findById</meta>
<generator class="assigned"/>

</id>

<property
name="ssn"
type="java.lang.String"
column="SSN"
length="9"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="use-in-equals">true</meta>
<meta attribute="finder">findBySSN</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="filenum"
type="java.lang.String"
column="FILENUM"
length="6"
>
<meta attribute="use-in-tostring">true</meta>
</property>
<property
name="compcode"
type="java.lang.String"
column="COMPCODE"
length="5"
>
<meta attribute="finder">findByCompanyCode</meta>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="lname"
type="java.lang.String"
column="LNAME"
length="50"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="fname"
type="java.lang.String"
column="FNAME"
length="50"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="costctr"
type="java.lang.String"
column="COSTCTR"
length="6"
>
<meta attribute="finder">findByCostCenter</meta>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="locode"
type="java.lang.String"
column="LOCODE"
length="2"
>
<meta attribute="finder">findByLocationCode</meta>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="status"
type="java.lang.String"
column="STATUS"
length="1"
>
<meta attribute="finder">findByStatus</meta>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="hiredate"
type="java.sql.Date"
column="HIREDATE"
length="7"
>
<meta attribute="finder">findByHireDate</meta>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="termdate"
type="java.sql.Date"
column="TERMDATE"
length="7"
>
<meta attribute="finder">findByTermDate</meta>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="ctitlecode"
type="java.lang.String"
column="CTITLECODE"
length="15"
>
<meta attribute="finder">findByCorporateTitle</meta>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="benefittier"
type="java.lang.Byte"
column="BENEFITTIER"
length="2"
>
<meta attribute="finder">findByBenefitTier</meta>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>

<joined-subclass name="com.knight.model.EmployeeLDAP" table="EMPLOYEE_EXCHG">
<key column="EMPMASTID"/>
<property
name="userid"
type="java.lang.String"
column="USERID"
length="40"
>
<meta attribute="finder">findByNTAlias</meta>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="password"
type="byte[]"
column="PASSWORD"
length="40"
>
<meta attribute="scope-set">private</meta>
</property>
<property
name="telephone"
type="java.lang.String"
column="TELEPHONE"
length="40"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="email"
type="java.lang.String"
column="EMAIL"
length="50"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="cellphone"
type="java.lang.String"
column="CELLPHONE"
length="30"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="scope-set">private</meta>
</property>
<property
name="extension"
type="java.lang.String"
column="EXTENSION"
length="6"
>
<meta attribute="scope-set">private</meta>
</property>
<property
name="telephone2"
type="java.lang.String"
column="TELEPHONE2"
length="30"
>
<meta attribute="scope-set">private</meta>
</property>
<property
name="extension2"
type="java.lang.String"
column="EXTENSION2"
length="6"
>
<meta attribute="scope-set">private</meta>
</property>
<property
name="txtmsgid"
type="java.lang.String"
column="TXTMSGID"
length="40"
>
<meta attribute="scope-set">private</meta>
</property>
<property
name="yahooim"
type="java.lang.String"
column="YAHOOIM"
length="50"
>
<meta attribute="scope-set">private</meta>
</property>
<property
name="msnim"
type="java.lang.String"
column="MSNIM"
length="50"
>
<meta attribute="scope-set">private</meta>
</property>
<property
name="aolim"
type="java.lang.String"
column="AOLIM"
length="50"
>
<meta attribute="scope-set">private</meta>
</property>
<property
name="newEmpEmailSent"
type="java.lang.Boolean"
column="NEW_EMP_EMAIL_SENT"
length="1"
>
<meta attribute="finder">findByNewEmpEmailSentFlag</meta>
<meta attribute="scope-set">private</meta>
</property>

</joined-subclass>

</class>
</hibernate-mapping>




Here is my hbm2java config file

<?xml version="1.0"?>

<codegen>

<generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/>

<generate renderer="net.sf.hibernate.tool.hbm2java.FinderRenderer"
package="com.knight.finder"
suffix="Finder"/>
suffix="Finder"
renderer="net.sf.hibernate.tool.hbm2java.FinderRenderer"/>


</codegen>

I am going against an Oracle DB 9.2, but that shouldn't be relevant in this case.

I am having trouble getting Log4j working with this so no debug info for now. Will work on it.

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.