Answer the question
In order to leave comments, you need to log in
Working with hbm.xml, how to properly map classes?
I'm trying to map two classes in one scheme .. The Address class throws an error, who can explain the error itself?
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)*)" .
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.demo.User" table="Users">
<id name="id" type="int" column="user_id">
<generator class="increment"/>
</id>
<property name="first_name" column="first_name" type="java.lang.String"/>
<property name="last_name" column="last_name" type="java.lang.String"/>
<property name="salary" column="salary" type="int"/>
</class>
<class name="com.demo.Address" table="Address">
<property name="street" column="street" type="java.lang.String"></property>
<property name="city" column="city" type="java.lang.String"></property>
<property name="country" column="country" type="java.lang.String"></property>
</class>
</hibernate-mapping>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question