-->
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.  [ 4 posts ] 
Author Message
 Post subject: What's the use of "net.sf.hibernate.cfg.NamingStrategy&
PostPosted: Wed Aug 17, 2005 11:46 pm 
Newbie

Joined: Sun Aug 14, 2005 6:07 am
Posts: 14
Location: China
The interface net.sf.hibernate.cfg.NamingStrategy allows you to specify a "naming standard" for database objects. You may provide rules for automatically generating database identifiers from Java identifiers or for processing "logical" column and table names given in the mapping file into "physical" table and column names. This feature helps reduce the verbosity of the mapping document, eliminating repetitive noise (TBL_ prefixes, for example). The default strategy used by Hibernate is quite minimal. You may specify a different strategy by calling Configuration.setNamingStrategy() before adding mappings.

Code:
SessionFactory sf = new Configuration()
    .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)
    .addFile("Vertex.hbm.xml")
    .addFile("Edge.hbm.xml")
    .buildSessionFactory();


net.sf.hibernate.cfg.ImprovedNamingStrategy is a built-in strategy that might be a useful starting point for some applications.


The text above is intercepted from the Hibernate QuickStart Document.

But i don't catch it means?

Can u tell me what does the code above do?

_________________
Confidence,Persistence & Endurance lead to Success!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 2:28 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Look at the interface.
The method names tell you all.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 9:23 am 
Newbie

Joined: Sun Aug 14, 2005 6:07 am
Posts: 14
Location: China
alesj wrote:
Look at the interface.
The method names tell you all.


I have read but i can't get the meaning

Can u give me an example?

_________________
Confidence,Persistence & Endurance lead to Success!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 10:42 pm 
Newbie

Joined: Sun Aug 14, 2005 6:07 am
Posts: 14
Location: China
up

_________________
Confidence,Persistence & Endurance lead to Success!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.