-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Injection of attribute locale in mapping files classes
PostPosted: Thu Sep 14, 2006 4:42 pm 
Newbie

Joined: Thu Sep 14, 2006 4:05 pm
Posts: 1
Location: Brasil
Hi everbody,

I have the follow situation on Database:

Image

Thats because I have to internationalize the name and details of products.

I think the one right solution for mapping this was the follow:

Code:
<hibernate-mapping package="model">

<class name="Product" table="PRODUCT" >
   <id name="id" column="idProduct" unsaved-value="null">
      <generator class="identity"/>
   </id>

   <property name="price" column="price" not-null="true" type="currency"/>

   <bag name="productDetails" cascade="all" lazy="true">
      <key column="FKidProduct" not-null="true"/>
      <one-to-many class="ProductDetail"/>
   </bag>

</class>

</hibernate-mapping>


On that way I have to create two business classes: Product and ProductDetail, with a relation of aggregation between that, and then create another hibernat-mapping to class ProductDetail, ok.

But I dont want to let my business classes knows the internationalization, I have to use my Product class like this:
Image

So, I need to find a way to inject the atributte locale (coming from my application) in this hibernate mapping to get the right name and details from my table PRODUCT_DETAILS depending of the key Locale that I have to inject.

Anyone can help me to find what aspect of hibernate I have to do research in order to resolve this problem?? I am using Spring + Hibernates 3 on my applications.

Thanks.

_________________
André


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.