- This topic has 4 replies, 2 voices, and was last updated 18 years, 7 months ago by Christian Casamirra.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
Christian CasamirraMemberI get
The method find(String, String, NullableType) is undefined for the type Session
when writing
List users = sess.find( "select users.active " + "from Mailbox as users " + "where users.username = ? ", uid, Hibernate.STRING );
Seems like org.hibernate.Session doesn’t support the method find …
Christian CasamirraMemberI’m using
Eclipse 3.1.1
MyEclipse 4.1.0 updated to Version: 4.1.1 GAThis is the Mailbox.hbm.xml:
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Mapping file autogenerated by MyEclipse - Hibernate Tools --> <hibernate-mapping> <class name="theo.feperic2.hib.Mailbox" table="mailbox" catalog="postfix"> <id name="username" type="string"> <column name="username" /> <generator class="assigned" /> </id> <property name="password" type="string"> <column name="password" not-null="true" /> </property> <property name="name" type="string"> <column name="name" not-null="true" /> </property> <property name="maildir" type="string"> <column name="maildir" not-null="true" /> </property> <property name="quota" type="integer"> <column name="quota" not-null="true" /> </property> <property name="domain" type="string"> <column name="domain" not-null="true" /> </property> <property name="created" type="timestamp"> <column name="created" length="19" not-null="true" /> </property> <property name="modified" type="timestamp"> <column name="modified" length="19" not-null="true" /> </property> <property name="active" type="byte"> <column name="active" not-null="true" /> </property> </class> </hibernate-mapping>
Christian CasamirraMemberConfiguration Summary
*** Date: Thu Mar 09 16:05:39 CET 2006 *** System properties: OS=WindowsXP OS version=5.1 Java version=1.4.2_10 *** MyEclipse details: MyEclipse Enterprise Workbench Version: 4.1.1 GA Build id: 20060228-4.1.1-GA *** Eclipse details: Eclipse SDK Version: 3.1.1 Build id: M20050929-0840 Eclipse Platform Version: 3.1.1 Build id: M20050929-0840 Eclipse RCP Version: 3.1.1 Build id: M20050929-0840 Eclipse Java Development Tools Version: 3.1.1 Build id: M20050929-0840 Eclipse Plug-in Development Environment Version: 3.1.1 Build id: M20050929-0840 Eclipse Project SDK Version: 3.1.1 Build id: M20050929-0840 Eclipse startup command=-os win32 -ws win32 -arch x86 -launcher C:\eclipse\eclipse.exe -name Eclipse -showsplash 600 -exitdata 944_38 -vm C:\Programmi\java\j2re1.4.2_10\bin\javaw.exe
Haris PecoMembercasc,
You are correct : org.hibernate.Session doesn’t support find.You have 2 choices
– use org.hibernate.clasic.Session
or (better)
– useList users = sess.createQuery( "select users.active " + "from Mailbox as users " + "where users.username = ? ").setParemeter( uid, Hibernate.STRING).list();
Christian CasamirraMemberthanx
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)