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     * The base model implementation for the UserTrackerPath service. Represents a row in the "UserTrackerPath" database table, with each column mapped to a property of this class.
038     *
039     * <p>
040     * This implementation and its corresponding interface {@link com.liferay.portal.model.UserTrackerPathModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link UserTrackerPathImpl}.
041     * </p>
042     *
043     * <p>
044     * Never modify or reference this class directly. All methods that expect a user tracker path model instance should use the {@link com.liferay.portal.model.UserTrackerPath} interface instead.
045     * </p>
046     *
047     * @author Brian Wing Shun Chan
048     * @see UserTrackerPathImpl
049     * @see com.liferay.portal.model.UserTrackerPath
050     * @see com.liferay.portal.model.UserTrackerPathModel
051     * @generated
052     */
053    public class UserTrackerPathModelImpl extends BaseModelImpl<UserTrackerPath>
054            implements UserTrackerPathModel {
055            public static final String TABLE_NAME = "UserTrackerPath";
056            public static final Object[][] TABLE_COLUMNS = {
057                            { "userTrackerPathId", new Integer(Types.BIGINT) },
058                            { "userTrackerId", new Integer(Types.BIGINT) },
059                            { "path_", new Integer(Types.VARCHAR) },
060                            { "pathDate", new Integer(Types.TIMESTAMP) }
061                    };
062            public static final String TABLE_SQL_CREATE = "create table UserTrackerPath (userTrackerPathId LONG not null primary key,userTrackerId LONG,path_ STRING null,pathDate DATE null)";
063            public static final String TABLE_SQL_DROP = "drop table UserTrackerPath";
064            public static final String DATA_SOURCE = "liferayDataSource";
065            public static final String SESSION_FACTORY = "liferaySessionFactory";
066            public static final String TX_MANAGER = "liferayTransactionManager";
067            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
068                                    "value.object.entity.cache.enabled.com.liferay.portal.model.UserTrackerPath"),
069                            true);
070            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
071                                    "value.object.finder.cache.enabled.com.liferay.portal.model.UserTrackerPath"),
072                            true);
073            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
074                                    "lock.expiration.time.com.liferay.portal.model.UserTrackerPath"));
075    
076            public UserTrackerPathModelImpl() {
077            }
078    
079            public long getPrimaryKey() {
080                    return _userTrackerPathId;
081            }
082    
083            public void setPrimaryKey(long pk) {
084                    setUserTrackerPathId(pk);
085            }
086    
087            public Serializable getPrimaryKeyObj() {
088                    return new Long(_userTrackerPathId);
089            }
090    
091            public long getUserTrackerPathId() {
092                    return _userTrackerPathId;
093            }
094    
095            public void setUserTrackerPathId(long userTrackerPathId) {
096                    _userTrackerPathId = userTrackerPathId;
097            }
098    
099            public long getUserTrackerId() {
100                    return _userTrackerId;
101            }
102    
103            public void setUserTrackerId(long userTrackerId) {
104                    _userTrackerId = userTrackerId;
105            }
106    
107            public String getPath() {
108                    if (_path == null) {
109                            return StringPool.BLANK;
110                    }
111                    else {
112                            return _path;
113                    }
114            }
115    
116            public void setPath(String path) {
117                    _path = path;
118            }
119    
120            public Date getPathDate() {
121                    return _pathDate;
122            }
123    
124            public void setPathDate(Date pathDate) {
125                    _pathDate = pathDate;
126            }
127    
128            public UserTrackerPath toEscapedModel() {
129                    if (isEscapedModel()) {
130                            return (UserTrackerPath)this;
131                    }
132                    else {
133                            return (UserTrackerPath)Proxy.newProxyInstance(UserTrackerPath.class.getClassLoader(),
134                                    new Class[] { UserTrackerPath.class },
135                                    new AutoEscapeBeanHandler(this));
136                    }
137            }
138    
139            public ExpandoBridge getExpandoBridge() {
140                    if (_expandoBridge == null) {
141                            _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(0,
142                                            UserTrackerPath.class.getName(), getPrimaryKey());
143                    }
144    
145                    return _expandoBridge;
146            }
147    
148            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
149                    getExpandoBridge().setAttributes(serviceContext);
150            }
151    
152            public Object clone() {
153                    UserTrackerPathImpl clone = new UserTrackerPathImpl();
154    
155                    clone.setUserTrackerPathId(getUserTrackerPathId());
156                    clone.setUserTrackerId(getUserTrackerId());
157                    clone.setPath(getPath());
158                    clone.setPathDate(getPathDate());
159    
160                    return clone;
161            }
162    
163            public int compareTo(UserTrackerPath userTrackerPath) {
164                    long pk = userTrackerPath.getPrimaryKey();
165    
166                    if (getPrimaryKey() < pk) {
167                            return -1;
168                    }
169                    else if (getPrimaryKey() > pk) {
170                            return 1;
171                    }
172                    else {
173                            return 0;
174                    }
175            }
176    
177            public boolean equals(Object obj) {
178                    if (obj == null) {
179                            return false;
180                    }
181    
182                    UserTrackerPath userTrackerPath = null;
183    
184                    try {
185                            userTrackerPath = (UserTrackerPath)obj;
186                    }
187                    catch (ClassCastException cce) {
188                            return false;
189                    }
190    
191                    long pk = userTrackerPath.getPrimaryKey();
192    
193                    if (getPrimaryKey() == pk) {
194                            return true;
195                    }
196                    else {
197                            return false;
198                    }
199            }
200    
201            public int hashCode() {
202                    return (int)getPrimaryKey();
203            }
204    
205            public String toString() {
206                    StringBundler sb = new StringBundler(9);
207    
208                    sb.append("{userTrackerPathId=");
209                    sb.append(getUserTrackerPathId());
210                    sb.append(", userTrackerId=");
211                    sb.append(getUserTrackerId());
212                    sb.append(", path=");
213                    sb.append(getPath());
214                    sb.append(", pathDate=");
215                    sb.append(getPathDate());
216                    sb.append("}");
217    
218                    return sb.toString();
219            }
220    
221            public String toXmlString() {
222                    StringBundler sb = new StringBundler(16);
223    
224                    sb.append("<model><model-name>");
225                    sb.append("com.liferay.portal.model.UserTrackerPath");
226                    sb.append("</model-name>");
227    
228                    sb.append(
229                            "<column><column-name>userTrackerPathId</column-name><column-value><![CDATA[");
230                    sb.append(getUserTrackerPathId());
231                    sb.append("]]></column-value></column>");
232                    sb.append(
233                            "<column><column-name>userTrackerId</column-name><column-value><![CDATA[");
234                    sb.append(getUserTrackerId());
235                    sb.append("]]></column-value></column>");
236                    sb.append(
237                            "<column><column-name>path</column-name><column-value><![CDATA[");
238                    sb.append(getPath());
239                    sb.append("]]></column-value></column>");
240                    sb.append(
241                            "<column><column-name>pathDate</column-name><column-value><![CDATA[");
242                    sb.append(getPathDate());
243                    sb.append("]]></column-value></column>");
244    
245                    sb.append("</model>");
246    
247                    return sb.toString();
248            }
249    
250            private long _userTrackerPathId;
251            private long _userTrackerId;
252            private String _path;
253            private Date _pathDate;
254            private transient ExpandoBridge _expandoBridge;
255    }