-->
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: Help needed - Illegal SQL is genrated
PostPosted: Sun Feb 22, 2009 4:01 am 
Newbie

Joined: Thu Feb 19, 2009 9:28 am
Posts: 1
Hibernate version: 1.2

Mapping documents:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="SubClassProblem.Animal, SubClassProblem" table="[Animal]" lazy="true" polymorphism="implicit">
<id name="Key" column="[Key]">
<generator class="native" />
</id>

<property name="Name" column="[Name]" type="System.String"/>
<joined-subclass name="SubClassProblem.Dog, SubClassProblem" table="[Dog]" lazy="true">
<key column="[Key]"/>
<property name="TailLength" column="[TailLength]" type="System.Int32"/>
</joined-subclass>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
IQuery query = session.CreateQuery("select o.Key from Animal o where o.class = SubClassProblem.Dog");

Full stack trace of any exception that occurs:

Name and version of the database you are using:
MS SQLServer 2005

The generated SQL (show_sql=true):

select animal0_.[Key] as x0_0_ from [Animal] animal0_ where (case when animal0_1_.[Key] is not null then 1 when animal0_.[Key] is not null then 0 end=1

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html



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.