Hello,
Sorry for header, I could not find how I called my problem. I ll try to define what I want to create.
There will be a OriginalPlaneClasswhich will keep target values. For instance
Code:
public class OriginalPlaneClass{
private String targetLength;
private String targetcolor;
}
This targetLength will be saved and can not be changed never. (Users will enter this value too)
Then There will be a second class UserPlaneClass and users will enter actual data and this data will be kept in this class. For instance;
Code:
public class UserPlaneClass {
private String actualLength;
}
I will show to users target value and user will enter actual value. Then I will compare these values.
You can think it there will be master data, and actual data. The class two will contain all data of class one. A kind of copying class one. At the end there will be one OriginalPlaneClass and many UserPlaneClass.
What kind of structure do I need to set?
I did this, but I get LazyInitializationException while getting OriginalPlaneClass data from UserPlaneClass
Code:
class rootOne{
private String targetvalue;
}
class rootOneCopy extends rootOne{
private String actualValue;
public rootOneCopy () {
}
public rootOneCopy (rootOne rootOne) {
super(rootOne);
}
}
and mapping
Code:
<class name="rootOne" table="rootOne">
<id column="id" name="id" type="long">
<generator class="increment"/>
</id>
<property column="targetvalue" length="2" name="targetvalue" not-null="true" type="integer" unique="false"/>
<many-to-one class="model.Status" column="status" name="status" cascade="all" not-null="false"/>
</class>
<class name="rootOneCopy " table="rootOneCopy ">
<id column="id" name="id" type="long">
<generator class="increment"/>
</id>
<property column="targetvalue" length="2" name="targetvalue" not-null="true" type="integer" unique="false"/>
<many-to-one class="model.Status" column="status" name="status" cascade="all" not-null="false"/>
<property column="actualValue" length="2" name="actualValue" not-null="true" type="integer" unique="false"/>
</class>
What must be the architecture?