01: package org.apache.turbine.om.security.peer;
02:
03: /*
04: * Copyright 2001-2005 The Apache Software Foundation.
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License")
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: import org.apache.torque.util.BasePeer;
20:
21: import org.apache.turbine.util.db.map.TurbineMapBuilder;
22:
23: /**
24: * This class handles all database access for the VISITOR_ROLE table.
25: * This table contains all the roles that a given user can play.
26: *
27: * @author <a href="mailto:frank.kim@clearink.com">Frank Y. Kim</a>
28: * @author <a href="mailto:john.mcnally@clearink.com">John D. McNally</a>
29: * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
30: * @version $Id: UserGroupRolePeer.java 264148 2005-08-29 14:21:04Z henning $
31: */
32: public class UserGroupRolePeer extends BasePeer {
33: /** Serial Version UID */
34: private static final long serialVersionUID = -9097451661613525751L;
35:
36: /** The map builder for this Peer. */
37: private static final TurbineMapBuilder MAP_BUILDER = (TurbineMapBuilder) getMapBuilder(TurbineMapBuilder.class
38: .getName());
39:
40: /** The table name for this peer. */
41: public static final String TABLE_NAME = MAP_BUILDER
42: .getTableUserGroupRole();
43:
44: /** The column name for the visitor id field. */
45: public static final String USER_ID = MAP_BUILDER
46: .getUserGroupRole_UserId();
47:
48: /** The column name for the group id field. */
49: public static final String GROUP_ID = MAP_BUILDER
50: .getUserGroupRole_GroupId();
51:
52: /** The column name for the role id field. */
53: public static final String ROLE_ID = MAP_BUILDER
54: .getUserGroupRole_RoleId();
55:
56: /**
57: * Get the name of this table.
58: *
59: * @return A String with the name of the table.
60: */
61: public static String getTableName() {
62: return TABLE_NAME;
63: }
64:
65: /**
66: * Returns the full name of a column.
67: *
68: * @param name name of a column
69: * @return A String with the full name of the column.
70: */
71: public static String getColumnName(String name) {
72: StringBuffer sb = new StringBuffer();
73: sb.append(TABLE_NAME);
74: sb.append(".");
75: sb.append(name);
76: return sb.toString();
77: }
78: }
|