01: /*
02: * JBoss, Home of Professional Open Source
03: * Copyright 2005, JBoss Inc., and individual contributors as indicated
04: * by the @authors tag. See the copyright.txt in the distribution for a
05: * full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jbpm.db.hibernate;
23:
24: import org.hibernate.cfg.*;
25:
26: public class JbpmNamingStrategy implements NamingStrategy {
27:
28: public String classToTableName(String className) {
29: className = className.substring(className.lastIndexOf('.') + 1);
30: return "JBPM_" + className.toUpperCase();
31: }
32:
33: public String propertyToColumnName(String propertyName) {
34: return propertyName.toUpperCase() + "_";
35: }
36:
37: public String tableName(String tableName) {
38: return "JBPM_" + tableName;
39: }
40:
41: public String columnName(String columnName) {
42: return columnName + "_";
43: }
44:
45: public String propertyToTableName(String className,
46: String propertyName) {
47: return classToTableName(className) + "_"
48: + propertyName.toUpperCase();
49: }
50:
51: public String collectionTableName(String ownerEntityTable,
52: String associatedEntityTable, String propertyName) {
53: return null;
54: }
55:
56: public String joinKeyColumnName(String joinedColumn,
57: String joinedTable) {
58: return null;
59: }
60:
61: public String foreignKeyColumnName(String propertyName,
62: String propertyTableName, String referencedColumnName) {
63: return null;
64: }
65:
66: public String logicalColumnName(String columnName,
67: String propertyName) {
68: return null;
69: }
70:
71: public String logicalCollectionTableName(String tableName,
72: String ownerEntityTable, String associatedEntityTable,
73: String propertyName) {
74: return null;
75: }
76:
77: public String logicalCollectionColumnName(String columnName,
78: String propertyName, String referencedColumn) {
79: return null;
80: }
81:
82: public String collectionTableName(String arg0, String arg1,
83: String arg2, String arg3, String arg4) {
84: return null;
85: }
86:
87: public String foreignKeyColumnName(String arg0, String arg1,
88: String arg2, String arg3) {
89: return null;
90: }
91: }
|