Hi,
I am started reading hibernate. In one of my examples,I mentioned the "generated" attribute of the "property" element as generated="always" as per the hibernate documentation and some other book. But getting the below parser error.
public class Student {
private Long id;
private
String name;
private int age;
private Date updated;
// getters and setters
}
Mapping :
In my main class ...
But I am getting the below error when I run the code :
If I try with generated="true" as shown below, the
IDE is reporting error but the code is running.
<property name="updated" column="LAST_MODIFIED" update="false" insert="false" generated="true"/>
In the hibernate-mapping-3.0.dtd file of the hibernate jar, I could see below lines :
<!ELEMENT property (meta*,(column|formula)*,type?)>
<!ATTLIST property name CDATA #REQUIRED>
<!ATTLIST property node CDATA #IMPLIED>
<!ATTLIST property access CDATA #IMPLIED>
<!ATTLIST property type CDATA #IMPLIED>
<!ATTLIST property column CDATA #IMPLIED>
<!ATTLIST property length CDATA #IMPLIED>
<!ATTLIST property precision CDATA #IMPLIED>
<!ATTLIST property scale CDATA #IMPLIED>
<!ATTLIST property not-null (true|false) #IMPLIED>
<!ATTLIST property unique (true|false) "false">
<!ATTLIST property unique-key CDATA #IMPLIED>
<!ATTLIST property index CDATA #IMPLIED> <!-- include the columns spanned by this property in an index -->
<!ATTLIST property update (true|false) #IMPLIED>
<!ATTLIST property insert (true|false) #IMPLIED>
<!ATTLIST property optimistic-lock (true|false) "true"> <!-- only supported for properties of a class (not component) -->
<!ATTLIST property formula CDATA #IMPLIED>
<!ATTLIST property lazy (true|false) "false">
<!ATTLIST property generated (true|false) "false">
Could some one please advice, what I am doing wrong. Does it mean the documentation is not correct or am I missing something ??