-->
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.  [ 3 posts ] 
Author Message
 Post subject: Data localization
PostPosted: Tue Nov 15, 2005 8:58 am 
Newbie

Joined: Tue Nov 15, 2005 8:12 am
Posts: 3
Hi All ...

How do you think about this possible new feature of Hibernate ...

Problem and here decision:
1) Your need localize some data of your bean (ru / en)

2) Writing default object.
Code:
public class Article {
    String title;
    String text;
    ...........
}


3) In configuration file you declare locales.
Code:
<locales>
    <locale default="true">ru</locale>
    <locale>en</locale>
</locales>

)

4) In class mapping you declare columns, that you want to localize.

Code:
<hibernate-mapping>
    <class
            name="Article"
            table="ARTICLE">
......
        <property
                name="title"
                column="TITLE"
                localize="true"
                type="string" />

        <property
                name="text"
                column="TEXT
                type="string"
                localize="true"
                length="500"/>
    </class>
</hibernate-mapping>


5) After execution Hibernate To DDL will be create next table
Code:
CREATE TABLE ARTICLE (
    TITLE_RU     VARCHAR(...)...,
    TITLE_EN     VARCHAR(...)...,

    TEXT_RU     VARCHAR(...)...,
    TEXT_EN     VARCHAR(...)...
)


6) For communication with object will be using default mechanism (default locale) or with locale setting.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 9:10 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
Meh, not impressed.

Large amounts of languages will create stupidly large tables.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 9:28 am 
Newbie

Joined: Tue Nov 15, 2005 8:12 am
Posts: 3
jamie_dainton wrote:
Meh, not impressed.

Large amounts of languages will create stupidly large tables.


May be, but i think that some system will have a little of same tables


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

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.