KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > db > hibernate > JbpmNamingStrategy


1 package org.jbpm.db.hibernate;
2
3 import org.hibernate.cfg.*;
4
5 public class JbpmNamingStrategy implements NamingStrategy {
6
7   public String JavaDoc classToTableName(String JavaDoc className) {
8     className = className.substring(className.lastIndexOf('.')+1);
9     return "JBPM_"+className.toUpperCase();
10   }
11
12   public String JavaDoc propertyToColumnName(String JavaDoc propertyName) {
13     return propertyName.toUpperCase()+"_";
14   }
15
16   public String JavaDoc tableName(String JavaDoc tableName) {
17     return "JBPM_"+tableName;
18   }
19
20   public String JavaDoc columnName(String JavaDoc columnName) {
21     return columnName+"_";
22   }
23
24   public String JavaDoc propertyToTableName(String JavaDoc className, String JavaDoc propertyName) {
25     return classToTableName(className)+"_"+propertyName.toUpperCase();
26   }
27 }
28
Popular Tags