Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: Hibernate3.2.5 ga
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.ball.Ball" table="my_table" lazy="false" dynamic-insert="true" dynamic-update="true">
<id name="ballNumber" column="ball_no">
<generator name="assign"/>
</id>
<many-to-one name="bag" class="org.Bag">
<column name="No"/>
<formula>'A'</formula>
</class>
</hibernate-mapping>
when ever i am using formula in the Mapping if the parent is not there also it is inserting in the DB. but in actual case it shouldn't. And i want to assign a ball to Bag name whose Name is 'A'.
Is there is any other way to do this.
Please help me....:
Read this:
http://hibernate.org/42.html