001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.util.GetterUtil;
019    import com.liferay.portal.kernel.util.StringBundler;
020    import com.liferay.portal.kernel.util.StringPool;
021    import com.liferay.portal.model.UserTrackerPath;
022    import com.liferay.portal.model.UserTrackerPathModel;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import com.liferay.portlet.expando.model.ExpandoBridge;
026    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
027    
028    import java.io.Serializable;
029    
030    import java.lang.reflect.Proxy;
031    
032    import java.sql.Types;
033    
034    import java.util.Date;
035    
036    /**
037     * <p>
038     * This interface is a model that represents the UserTrackerPath table in the
039     * database.
040     * </p>
041     *
042     * @author    Brian Wing Shun Chan
043     * @see       UserTrackerPathImpl
044     * @see       com.liferay.portal.model.UserTrackerPath
045     * @see       com.liferay.portal.model.UserTrackerPathModel
046     * @generated
047     */
048    public class UserTrackerPathModelImpl extends BaseModelImpl<UserTrackerPath>
049            implements UserTrackerPathModel {
050            public static final String TABLE_NAME = "UserTrackerPath";
051            public static final Object[][] TABLE_COLUMNS = {
052                            { "userTrackerPathId", new Integer(Types.BIGINT) },
053                            { "userTrackerId", new Integer(Types.BIGINT) },
054                            { "path_", new Integer(Types.VARCHAR) },
055                            { "pathDate", new Integer(Types.TIMESTAMP) }
056                    };
057            public static final String TABLE_SQL_CREATE = "create table UserTrackerPath (userTrackerPathId LONG not null primary key,userTrackerId LONG,path_ STRING null,pathDate DATE null)";
058            public static final String TABLE_SQL_DROP = "drop table UserTrackerPath";
059            public static final String DATA_SOURCE = "liferayDataSource";
060            public static final String SESSION_FACTORY = "liferaySessionFactory";
061            public static final String TX_MANAGER = "liferayTransactionManager";
062            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
063                                    "value.object.entity.cache.enabled.com.liferay.portal.model.UserTrackerPath"),
064                            true);
065            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
066                                    "value.object.finder.cache.enabled.com.liferay.portal.model.UserTrackerPath"),
067                            true);
068            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
069                                    "lock.expiration.time.com.liferay.portal.model.UserTrackerPath"));
070    
071            public UserTrackerPathModelImpl() {
072            }
073    
074            public long getPrimaryKey() {
075                    return _userTrackerPathId;
076            }
077    
078            public void setPrimaryKey(long pk) {
079                    setUserTrackerPathId(pk);
080            }
081    
082            public Serializable getPrimaryKeyObj() {
083                    return new Long(_userTrackerPathId);
084            }
085    
086            public long getUserTrackerPathId() {
087                    return _userTrackerPathId;
088            }
089    
090            public void setUserTrackerPathId(long userTrackerPathId) {
091                    _userTrackerPathId = userTrackerPathId;
092            }
093    
094            public long getUserTrackerId() {
095                    return _userTrackerId;
096            }
097    
098            public void setUserTrackerId(long userTrackerId) {
099                    _userTrackerId = userTrackerId;
100            }
101    
102            public String getPath() {
103                    if (_path == null) {
104                            return StringPool.BLANK;
105                    }
106                    else {
107                            return _path;
108                    }
109            }
110    
111            public void setPath(String path) {
112                    _path = path;
113            }
114    
115            public Date getPathDate() {
116                    return _pathDate;
117            }
118    
119            public void setPathDate(Date pathDate) {
120                    _pathDate = pathDate;
121            }
122    
123            public UserTrackerPath toEscapedModel() {
124                    if (isEscapedModel()) {
125                            return (UserTrackerPath)this;
126                    }
127                    else {
128                            return (UserTrackerPath)Proxy.newProxyInstance(UserTrackerPath.class.getClassLoader(),
129                                    new Class[] { UserTrackerPath.class },
130                                    new AutoEscapeBeanHandler(this));
131                    }
132            }
133    
134            public ExpandoBridge getExpandoBridge() {
135                    if (_expandoBridge == null) {
136                            _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(0,
137                                            UserTrackerPath.class.getName(), getPrimaryKey());
138                    }
139    
140                    return _expandoBridge;
141            }
142    
143            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
144                    getExpandoBridge().setAttributes(serviceContext);
145            }
146    
147            public Object clone() {
148                    UserTrackerPathImpl clone = new UserTrackerPathImpl();
149    
150                    clone.setUserTrackerPathId(getUserTrackerPathId());
151                    clone.setUserTrackerId(getUserTrackerId());
152                    clone.setPath(getPath());
153                    clone.setPathDate(getPathDate());
154    
155                    return clone;
156            }
157    
158            public int compareTo(UserTrackerPath userTrackerPath) {
159                    long pk = userTrackerPath.getPrimaryKey();
160    
161                    if (getPrimaryKey() < pk) {
162                            return -1;
163                    }
164                    else if (getPrimaryKey() > pk) {
165                            return 1;
166                    }
167                    else {
168                            return 0;
169                    }
170            }
171    
172            public boolean equals(Object obj) {
173                    if (obj == null) {
174                            return false;
175                    }
176    
177                    UserTrackerPath userTrackerPath = null;
178    
179                    try {
180                            userTrackerPath = (UserTrackerPath)obj;
181                    }
182                    catch (ClassCastException cce) {
183                            return false;
184                    }
185    
186                    long pk = userTrackerPath.getPrimaryKey();
187    
188                    if (getPrimaryKey() == pk) {
189                            return true;
190                    }
191                    else {
192                            return false;
193                    }
194            }
195    
196            public int hashCode() {
197                    return (int)getPrimaryKey();
198            }
199    
200            public String toString() {
201                    StringBundler sb = new StringBundler(9);
202    
203                    sb.append("{userTrackerPathId=");
204                    sb.append(getUserTrackerPathId());
205                    sb.append(", userTrackerId=");
206                    sb.append(getUserTrackerId());
207                    sb.append(", path=");
208                    sb.append(getPath());
209                    sb.append(", pathDate=");
210                    sb.append(getPathDate());
211                    sb.append("}");
212    
213                    return sb.toString();
214            }
215    
216            public String toXmlString() {
217                    StringBundler sb = new StringBundler(16);
218    
219                    sb.append("<model><model-name>");
220                    sb.append("com.liferay.portal.model.UserTrackerPath");
221                    sb.append("</model-name>");
222    
223                    sb.append(
224                            "<column><column-name>userTrackerPathId</column-name><column-value><![CDATA[");
225                    sb.append(getUserTrackerPathId());
226                    sb.append("]]></column-value></column>");
227                    sb.append(
228                            "<column><column-name>userTrackerId</column-name><column-value><![CDATA[");
229                    sb.append(getUserTrackerId());
230                    sb.append("]]></column-value></column>");
231                    sb.append(
232                            "<column><column-name>path</column-name><column-value><![CDATA[");
233                    sb.append(getPath());
234                    sb.append("]]></column-value></column>");
235                    sb.append(
236                            "<column><column-name>pathDate</column-name><column-value><![CDATA[");
237                    sb.append(getPathDate());
238                    sb.append("]]></column-value></column>");
239    
240                    sb.append("</model>");
241    
242                    return sb.toString();
243            }
244    
245            private long _userTrackerPathId;
246            private long _userTrackerId;
247            private String _path;
248            private Date _pathDate;
249            private transient ExpandoBridge _expandoBridge;
250    }