1
22
23 package com.liferay.portal.model.impl;
24
25 import com.liferay.portal.kernel.util.GetterUtil;
26 import com.liferay.portal.model.impl.BaseModelImpl;
27 import com.liferay.portal.service.persistence.UserGroupRolePK;
28 import com.liferay.portal.util.PropsUtil;
29
30 import java.io.Serializable;
31
32 import java.sql.Types;
33
34
54 public class UserGroupRoleModelImpl extends BaseModelImpl {
55 public static String TABLE_NAME = "UserGroupRole";
56 public static Object[][] TABLE_COLUMNS = {
57 { "userId", new Integer(Types.BIGINT) },
58 { "groupId", new Integer(Types.BIGINT) },
59 { "roleId", new Integer(Types.BIGINT) }
60 };
61 public static String TABLE_SQL_CREATE = "create table UserGroupRole (userId LONG not null,groupId LONG not null,roleId LONG not null,primary key (userId, groupId, roleId))";
62 public static String TABLE_SQL_DROP = "drop table UserGroupRole";
63 public static boolean XSS_ALLOW_BY_MODEL = GetterUtil.getBoolean(PropsUtil.get(
64 "xss.allow.com.liferay.portal.model.UserGroupRole"), XSS_ALLOW);
65 public static long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
66 "lock.expiration.time.com.liferay.portal.model.UserGroupRoleModel"));
67
68 public UserGroupRoleModelImpl() {
69 }
70
71 public UserGroupRolePK getPrimaryKey() {
72 return new UserGroupRolePK(_userId, _groupId, _roleId);
73 }
74
75 public void setPrimaryKey(UserGroupRolePK pk) {
76 setUserId(pk.userId);
77 setGroupId(pk.groupId);
78 setRoleId(pk.roleId);
79 }
80
81 public Serializable getPrimaryKeyObj() {
82 return new UserGroupRolePK(_userId, _groupId, _roleId);
83 }
84
85 public long getUserId() {
86 return _userId;
87 }
88
89 public void setUserId(long userId) {
90 if (userId != _userId) {
91 _userId = userId;
92 }
93 }
94
95 public long getGroupId() {
96 return _groupId;
97 }
98
99 public void setGroupId(long groupId) {
100 if (groupId != _groupId) {
101 _groupId = groupId;
102 }
103 }
104
105 public long getRoleId() {
106 return _roleId;
107 }
108
109 public void setRoleId(long roleId) {
110 if (roleId != _roleId) {
111 _roleId = roleId;
112 }
113 }
114
115 public Object clone() {
116 UserGroupRoleImpl clone = new UserGroupRoleImpl();
117 clone.setUserId(getUserId());
118 clone.setGroupId(getGroupId());
119 clone.setRoleId(getRoleId());
120
121 return clone;
122 }
123
124 public int compareTo(Object obj) {
125 if (obj == null) {
126 return -1;
127 }
128
129 UserGroupRoleImpl userGroupRole = (UserGroupRoleImpl)obj;
130 UserGroupRolePK pk = userGroupRole.getPrimaryKey();
131
132 return getPrimaryKey().compareTo(pk);
133 }
134
135 public boolean equals(Object obj) {
136 if (obj == null) {
137 return false;
138 }
139
140 UserGroupRoleImpl userGroupRole = null;
141
142 try {
143 userGroupRole = (UserGroupRoleImpl)obj;
144 }
145 catch (ClassCastException cce) {
146 return false;
147 }
148
149 UserGroupRolePK pk = userGroupRole.getPrimaryKey();
150
151 if (getPrimaryKey().equals(pk)) {
152 return true;
153 }
154 else {
155 return false;
156 }
157 }
158
159 public int hashCode() {
160 return getPrimaryKey().hashCode();
161 }
162
163 private long _userId;
164 private long _groupId;
165 private long _roleId;
166 }