Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0.5
Mapping documents:
<hibernate-mapping package="org.hibernate.auction.model">
<class name="Category"
table="CATEGORY"
lazy="true">
<!-- Common id property. -->
<id name="id"
type="long"
column="CATEGORY_ID"
unsaved-value="null"
access="org.hibernate.auction.persistence.DirectSetAccessor">
<generator class="native"/>
</id>
<!-- A versioned entity. -->
<version name="version"
column="VERSION"
access="net.sf.hibernate.property.DirectPropertyAccessor"/>
<!-- Name is limited to 255 characters.-->
<property name="name"
type="string">
<column name="NAME"
not-null="true"
length="255"
unique-key="UNIQUE_NAME_AT_LEVEL"/>
</property>
<!-- We can't change the creation time, so map it with update="false". -->
<property name="created"
column="CREATED"
type="java.util.Date"
update="false"
not-null="true"
access="org.hibernate.auction.persistence.DirectSetAccessor"/>
<!-- Parent can be null for root categories. -->
<many-to-one name="parentCategory"
cascade="none"
outer-join="false"
foreign-key="FK1_PARENT_CATEGORY_ID">
<column name="PARENT_CATEGORY_ID"
not-null="false"
unique-key="UNIQUE_NAME_AT_LEVEL"/>
</many-to-one>
<set name="childCategories"
cascade="all-delete-orphan"
inverse="true"
lazy="true"
batch-size="10"
access="org.hibernate.auction.persistence.DirectSetAccessor">
<key column="PARENT_CATEGORY_ID"/>
<one-to-many class="Category"/>
</set>
<set name="categorizedItems"
cascade="all-delete-orphan"
inverse="true"
outer-join="false"
access="org.hibernate.auction.persistence.DirectSetAccessor">
<key foreign-key="FK1_CATEGORIZED_ITEM_ID">
<column name="CATEGORY_ID" not-null="true" length="16"/>
</key>
<one-to-many class="CategorizedItem"/>
</set>
</class>
</hibernate-mapping>
Name and version of the database you are using: MySql 4.1
Hi guys,
I am refering to the Category POJO from CaveatEmptor (caveatemptor-0.9.5). Anyone could kindly suggest how to make it support multipls languages? It is bcoz if the user wanna view my website in other language such as France, then I gotta retrieve the category's name in France language from database.
Is it the best way to create another table to hold multiple languages and refer back to the Category table id?
TIA !
regards,
Mark