Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version:[/b]
[b]Mapping documents:[/b]
[b]Code between sessionFactory.openSession() and session.close():[/b]
[b]Full stack trace of any exception that occurs:[/b]
[b]Name and version of the database you are using:[/b]
[b]The generated SQL (show_sql=true):[/b]
[b]Debug level Hibernate log excerpt:[/b]
Hi All
I am experiencing a very weird behaviour from hibernate...
I have a class and its been subclassed now I delete the subclass in my testcase it deletes correctlky but the problem is that it somehow still retrieves the same object though its no more in the db>????
it shoud lrightly throw some objct not foundexception.......
Please find below the snippet of hbm.xml
hibernate-mapping package="a">
<class name="CreditCard" table="CreditCard" lazy="true">
<id name="cardNumber" type="string" column="CardNumber">
<generator class="assigned" />
</id>
<!-- =============INHERITANCE PersonalCreditCard============ -->
<joined-subclass name="PersonalCreditCard"
table="PersonalCreditCard">
<key column="CardNumber" />
</joined-subclass>
</class>
</hibernate-mapping>
Now I delete this in my test case and it gotes from the db it correctly fires the deletes
Hibernate: select personalcr0_.CardNumber as CardNumber0_ from PersonalCreditCard personalcr0_ inner join CreditCard personalcr0_1_ on personalcr0_.CardNumber=personalcr0_1_.CardNumber where personalcr0_.CardNumber=?
Hibernate: delete from PersonalCreditCard where CardNumber=?
Hibernate: delete from CreditCard where CardNumber=?
Unit test
junit.framework.AssertionFailedError: Able to retrieve a deleted card there is something wrong here check card45343-555
Any ideas wahts happening?
Regards
Subu