KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > cfg > NamingStrategy


1 //$Id: NamingStrategy.java,v 1.1 2004/06/03 16:30:05 steveebersole Exp $
2
package org.hibernate.cfg;
3
4 /**
5  * A set of rules for determining the physical column
6  * and table names given the information in the mapping
7  * document. May be used to implement project-scoped
8  * naming standards for database objects.
9  *
10  * @see DefaultNamingStrategy
11  * @see ImprovedNamingStrategy
12  * @author Gavin King
13  */

14 public interface NamingStrategy {
15     /**
16      * Return a table name for an entity class
17      * @param className the fully-qualified class name
18      * @return a table name
19      */

20     public String JavaDoc classToTableName(String JavaDoc className);
21     /**
22      * Return a column name for a property path expression
23      * @param propertyName a property path
24      * @return a column name
25      */

26     public String JavaDoc propertyToColumnName(String JavaDoc propertyName);
27     /**
28      * Alter the table name given in the mapping document
29      * @param tableName a table name
30      * @return a table name
31      */

32     public String JavaDoc tableName(String JavaDoc tableName);
33     /**
34      * Alter the column name given in the mapping document
35      * @param columnName a column name
36      * @return a column name
37      */

38     public String JavaDoc columnName(String JavaDoc columnName);
39     /**
40      * Return a table name for a collection
41      * @param className the fully-qualified name of the owning entity class
42      * @param propertyName a property path
43      * @return a table name
44      */

45     public String JavaDoc propertyToTableName(String JavaDoc className, String JavaDoc propertyName);
46 }
47
Popular Tags