When i am using net beans to develop one standalone swing application which is transacting with derby database. In my database i dont have any ID field all columns are nullable but when i am mapping my abc.hbm.xml file and validating it is givin following error:-
The content of element type “class” must match “(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array),((join,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)”. [20]
Can anybody help me out with this error.
Cant we map that xml without having ID field in table???
Your XML is invalid, because it doesn’t conform to the hibernate DTD. As the error message says, every class element must have either one id sub-element, or one composite-id sub-element.
A hibernate entity must have an ID (simple or composite). Your database schema deosn’t seem very clean. You should have a primary key in every table.