Hi,
I have this mapping:
<hibernate-mapping package="mypackage">
<class name="BaseDocument" table="baseDocument">
<id name="id" type="long" column="id">
<generator class="native"/>
</id>
<property name="name" column="name" type="string"/>
<property name="createDate" column="createDate" type="timestamp"/>
<property name="lastModified" column="lastModified" type="timestamp"/>
</class>
</hibernate-mapping>
And this mapping, that inherits from the previous one
<hibernate-mapping package="mypackage" default-cascade="none">
<joined-subclass name="ExtendedDocument" extends="BaseDocument">
<key column="extendedDocumentId" />
<property name="data" type="string" />
</joined-subclass>
</hibernate-mapping>
I send this HQL query:
SELECT extendedDocument FROM ExtendedDocument AS extendedDocument
WHERE extendedDocument.active = true AND
(extendedDocument.class = mypackage.extendedDocument) AND
extendedDocument.createDate >= :minorDate AND
extendedDocument.createDate <= :majorDate
ORDER BY extendedDocument.createDate DESC
I don't know why, but the class name is ALWAYS translated to 0, even when this is not correct, because when it looks for the class of these rows, Hibernate traduces the instances to class number "1" instead of "0". The only problem is the criteria, that is always 0.
Thanks
Hibernate version:
2.1.7
Mapping documents:
See
Code between sessionFactory.openSession() and session.close():
N/A
Full stack trace of any exception that occurs:
N/A
Name and version of the database you are using:
SQL Server 2000
The generated SQL (show_sql=true):
See
Debug level Hibernate log excerpt:
N/A
|