001    /**
002     * Copyright (c) 2000-2012 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.portlet.bookmarks.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.json.JSON;
020    import com.liferay.portal.kernel.util.GetterUtil;
021    import com.liferay.portal.kernel.util.ProxyUtil;
022    import com.liferay.portal.kernel.util.StringBundler;
023    import com.liferay.portal.kernel.util.StringPool;
024    import com.liferay.portal.kernel.workflow.WorkflowConstants;
025    import com.liferay.portal.model.CacheModel;
026    import com.liferay.portal.model.impl.BaseModelImpl;
027    import com.liferay.portal.service.ServiceContext;
028    import com.liferay.portal.util.PortalUtil;
029    
030    import com.liferay.portlet.bookmarks.model.BookmarksEntry;
031    import com.liferay.portlet.bookmarks.model.BookmarksEntryModel;
032    import com.liferay.portlet.bookmarks.model.BookmarksEntrySoap;
033    import com.liferay.portlet.expando.model.ExpandoBridge;
034    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
035    
036    import java.io.Serializable;
037    
038    import java.sql.Types;
039    
040    import java.util.ArrayList;
041    import java.util.Date;
042    import java.util.HashMap;
043    import java.util.List;
044    import java.util.Map;
045    
046    /**
047     * The base model implementation for the BookmarksEntry service. Represents a row in the "BookmarksEntry" database table, with each column mapped to a property of this class.
048     *
049     * <p>
050     * This implementation and its corresponding interface {@link com.liferay.portlet.bookmarks.model.BookmarksEntryModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link BookmarksEntryImpl}.
051     * </p>
052     *
053     * @author Brian Wing Shun Chan
054     * @see BookmarksEntryImpl
055     * @see com.liferay.portlet.bookmarks.model.BookmarksEntry
056     * @see com.liferay.portlet.bookmarks.model.BookmarksEntryModel
057     * @generated
058     */
059    @JSON(strict = true)
060    public class BookmarksEntryModelImpl extends BaseModelImpl<BookmarksEntry>
061            implements BookmarksEntryModel {
062            /*
063             * NOTE FOR DEVELOPERS:
064             *
065             * Never modify or reference this class directly. All methods that expect a bookmarks entry model instance should use the {@link com.liferay.portlet.bookmarks.model.BookmarksEntry} interface instead.
066             */
067            public static final String TABLE_NAME = "BookmarksEntry";
068            public static final Object[][] TABLE_COLUMNS = {
069                            { "uuid_", Types.VARCHAR },
070                            { "entryId", Types.BIGINT },
071                            { "groupId", Types.BIGINT },
072                            { "companyId", Types.BIGINT },
073                            { "userId", Types.BIGINT },
074                            { "userName", Types.VARCHAR },
075                            { "createDate", Types.TIMESTAMP },
076                            { "modifiedDate", Types.TIMESTAMP },
077                            { "resourceBlockId", Types.BIGINT },
078                            { "folderId", Types.BIGINT },
079                            { "name", Types.VARCHAR },
080                            { "url", Types.VARCHAR },
081                            { "description", Types.VARCHAR },
082                            { "visits", Types.INTEGER },
083                            { "priority", Types.INTEGER },
084                            { "status", Types.INTEGER },
085                            { "statusByUserId", Types.BIGINT },
086                            { "statusByUserName", Types.VARCHAR },
087                            { "statusDate", Types.TIMESTAMP }
088                    };
089            public static final String TABLE_SQL_CREATE = "create table BookmarksEntry (uuid_ VARCHAR(75) null,entryId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,resourceBlockId LONG,folderId LONG,name VARCHAR(255) null,url STRING null,description STRING null,visits INTEGER,priority INTEGER,status INTEGER,statusByUserId LONG,statusByUserName VARCHAR(75) null,statusDate DATE null)";
090            public static final String TABLE_SQL_DROP = "drop table BookmarksEntry";
091            public static final String ORDER_BY_JPQL = " ORDER BY bookmarksEntry.folderId ASC, bookmarksEntry.name ASC";
092            public static final String ORDER_BY_SQL = " ORDER BY BookmarksEntry.folderId ASC, BookmarksEntry.name ASC";
093            public static final String DATA_SOURCE = "liferayDataSource";
094            public static final String SESSION_FACTORY = "liferaySessionFactory";
095            public static final String TX_MANAGER = "liferayTransactionManager";
096            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
097                                    "value.object.entity.cache.enabled.com.liferay.portlet.bookmarks.model.BookmarksEntry"),
098                            true);
099            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
100                                    "value.object.finder.cache.enabled.com.liferay.portlet.bookmarks.model.BookmarksEntry"),
101                            true);
102            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
103                                    "value.object.column.bitmask.enabled.com.liferay.portlet.bookmarks.model.BookmarksEntry"),
104                            true);
105            public static long COMPANYID_COLUMN_BITMASK = 1L;
106            public static long FOLDERID_COLUMN_BITMASK = 2L;
107            public static long GROUPID_COLUMN_BITMASK = 4L;
108            public static long RESOURCEBLOCKID_COLUMN_BITMASK = 8L;
109            public static long STATUS_COLUMN_BITMASK = 16L;
110            public static long USERID_COLUMN_BITMASK = 32L;
111            public static long UUID_COLUMN_BITMASK = 64L;
112            public static long NAME_COLUMN_BITMASK = 128L;
113    
114            /**
115             * Converts the soap model instance into a normal model instance.
116             *
117             * @param soapModel the soap model instance to convert
118             * @return the normal model instance
119             */
120            public static BookmarksEntry toModel(BookmarksEntrySoap soapModel) {
121                    if (soapModel == null) {
122                            return null;
123                    }
124    
125                    BookmarksEntry model = new BookmarksEntryImpl();
126    
127                    model.setUuid(soapModel.getUuid());
128                    model.setEntryId(soapModel.getEntryId());
129                    model.setGroupId(soapModel.getGroupId());
130                    model.setCompanyId(soapModel.getCompanyId());
131                    model.setUserId(soapModel.getUserId());
132                    model.setUserName(soapModel.getUserName());
133                    model.setCreateDate(soapModel.getCreateDate());
134                    model.setModifiedDate(soapModel.getModifiedDate());
135                    model.setResourceBlockId(soapModel.getResourceBlockId());
136                    model.setFolderId(soapModel.getFolderId());
137                    model.setName(soapModel.getName());
138                    model.setUrl(soapModel.getUrl());
139                    model.setDescription(soapModel.getDescription());
140                    model.setVisits(soapModel.getVisits());
141                    model.setPriority(soapModel.getPriority());
142                    model.setStatus(soapModel.getStatus());
143                    model.setStatusByUserId(soapModel.getStatusByUserId());
144                    model.setStatusByUserName(soapModel.getStatusByUserName());
145                    model.setStatusDate(soapModel.getStatusDate());
146    
147                    return model;
148            }
149    
150            /**
151             * Converts the soap model instances into normal model instances.
152             *
153             * @param soapModels the soap model instances to convert
154             * @return the normal model instances
155             */
156            public static List<BookmarksEntry> toModels(BookmarksEntrySoap[] soapModels) {
157                    if (soapModels == null) {
158                            return null;
159                    }
160    
161                    List<BookmarksEntry> models = new ArrayList<BookmarksEntry>(soapModels.length);
162    
163                    for (BookmarksEntrySoap soapModel : soapModels) {
164                            models.add(toModel(soapModel));
165                    }
166    
167                    return models;
168            }
169    
170            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
171                                    "lock.expiration.time.com.liferay.portlet.bookmarks.model.BookmarksEntry"));
172    
173            public BookmarksEntryModelImpl() {
174            }
175    
176            public long getPrimaryKey() {
177                    return _entryId;
178            }
179    
180            public void setPrimaryKey(long primaryKey) {
181                    setEntryId(primaryKey);
182            }
183    
184            public Serializable getPrimaryKeyObj() {
185                    return _entryId;
186            }
187    
188            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
189                    setPrimaryKey(((Long)primaryKeyObj).longValue());
190            }
191    
192            public Class<?> getModelClass() {
193                    return BookmarksEntry.class;
194            }
195    
196            public String getModelClassName() {
197                    return BookmarksEntry.class.getName();
198            }
199    
200            @Override
201            public Map<String, Object> getModelAttributes() {
202                    Map<String, Object> attributes = new HashMap<String, Object>();
203    
204                    attributes.put("uuid", getUuid());
205                    attributes.put("entryId", getEntryId());
206                    attributes.put("groupId", getGroupId());
207                    attributes.put("companyId", getCompanyId());
208                    attributes.put("userId", getUserId());
209                    attributes.put("userName", getUserName());
210                    attributes.put("createDate", getCreateDate());
211                    attributes.put("modifiedDate", getModifiedDate());
212                    attributes.put("resourceBlockId", getResourceBlockId());
213                    attributes.put("folderId", getFolderId());
214                    attributes.put("name", getName());
215                    attributes.put("url", getUrl());
216                    attributes.put("description", getDescription());
217                    attributes.put("visits", getVisits());
218                    attributes.put("priority", getPriority());
219                    attributes.put("status", getStatus());
220                    attributes.put("statusByUserId", getStatusByUserId());
221                    attributes.put("statusByUserName", getStatusByUserName());
222                    attributes.put("statusDate", getStatusDate());
223    
224                    return attributes;
225            }
226    
227            @Override
228            public void setModelAttributes(Map<String, Object> attributes) {
229                    String uuid = (String)attributes.get("uuid");
230    
231                    if (uuid != null) {
232                            setUuid(uuid);
233                    }
234    
235                    Long entryId = (Long)attributes.get("entryId");
236    
237                    if (entryId != null) {
238                            setEntryId(entryId);
239                    }
240    
241                    Long groupId = (Long)attributes.get("groupId");
242    
243                    if (groupId != null) {
244                            setGroupId(groupId);
245                    }
246    
247                    Long companyId = (Long)attributes.get("companyId");
248    
249                    if (companyId != null) {
250                            setCompanyId(companyId);
251                    }
252    
253                    Long userId = (Long)attributes.get("userId");
254    
255                    if (userId != null) {
256                            setUserId(userId);
257                    }
258    
259                    String userName = (String)attributes.get("userName");
260    
261                    if (userName != null) {
262                            setUserName(userName);
263                    }
264    
265                    Date createDate = (Date)attributes.get("createDate");
266    
267                    if (createDate != null) {
268                            setCreateDate(createDate);
269                    }
270    
271                    Date modifiedDate = (Date)attributes.get("modifiedDate");
272    
273                    if (modifiedDate != null) {
274                            setModifiedDate(modifiedDate);
275                    }
276    
277                    Long resourceBlockId = (Long)attributes.get("resourceBlockId");
278    
279                    if (resourceBlockId != null) {
280                            setResourceBlockId(resourceBlockId);
281                    }
282    
283                    Long folderId = (Long)attributes.get("folderId");
284    
285                    if (folderId != null) {
286                            setFolderId(folderId);
287                    }
288    
289                    String name = (String)attributes.get("name");
290    
291                    if (name != null) {
292                            setName(name);
293                    }
294    
295                    String url = (String)attributes.get("url");
296    
297                    if (url != null) {
298                            setUrl(url);
299                    }
300    
301                    String description = (String)attributes.get("description");
302    
303                    if (description != null) {
304                            setDescription(description);
305                    }
306    
307                    Integer visits = (Integer)attributes.get("visits");
308    
309                    if (visits != null) {
310                            setVisits(visits);
311                    }
312    
313                    Integer priority = (Integer)attributes.get("priority");
314    
315                    if (priority != null) {
316                            setPriority(priority);
317                    }
318    
319                    Integer status = (Integer)attributes.get("status");
320    
321                    if (status != null) {
322                            setStatus(status);
323                    }
324    
325                    Long statusByUserId = (Long)attributes.get("statusByUserId");
326    
327                    if (statusByUserId != null) {
328                            setStatusByUserId(statusByUserId);
329                    }
330    
331                    String statusByUserName = (String)attributes.get("statusByUserName");
332    
333                    if (statusByUserName != null) {
334                            setStatusByUserName(statusByUserName);
335                    }
336    
337                    Date statusDate = (Date)attributes.get("statusDate");
338    
339                    if (statusDate != null) {
340                            setStatusDate(statusDate);
341                    }
342            }
343    
344            @JSON
345            public String getUuid() {
346                    if (_uuid == null) {
347                            return StringPool.BLANK;
348                    }
349                    else {
350                            return _uuid;
351                    }
352            }
353    
354            public void setUuid(String uuid) {
355                    if (_originalUuid == null) {
356                            _originalUuid = _uuid;
357                    }
358    
359                    _uuid = uuid;
360            }
361    
362            public String getOriginalUuid() {
363                    return GetterUtil.getString(_originalUuid);
364            }
365    
366            @JSON
367            public long getEntryId() {
368                    return _entryId;
369            }
370    
371            public void setEntryId(long entryId) {
372                    _entryId = entryId;
373            }
374    
375            @JSON
376            public long getGroupId() {
377                    return _groupId;
378            }
379    
380            public void setGroupId(long groupId) {
381                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
382    
383                    if (!_setOriginalGroupId) {
384                            _setOriginalGroupId = true;
385    
386                            _originalGroupId = _groupId;
387                    }
388    
389                    _groupId = groupId;
390            }
391    
392            public long getOriginalGroupId() {
393                    return _originalGroupId;
394            }
395    
396            @JSON
397            public long getCompanyId() {
398                    return _companyId;
399            }
400    
401            public void setCompanyId(long companyId) {
402                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
403    
404                    if (!_setOriginalCompanyId) {
405                            _setOriginalCompanyId = true;
406    
407                            _originalCompanyId = _companyId;
408                    }
409    
410                    _companyId = companyId;
411            }
412    
413            public long getOriginalCompanyId() {
414                    return _originalCompanyId;
415            }
416    
417            @JSON
418            public long getUserId() {
419                    return _userId;
420            }
421    
422            public void setUserId(long userId) {
423                    _columnBitmask |= USERID_COLUMN_BITMASK;
424    
425                    if (!_setOriginalUserId) {
426                            _setOriginalUserId = true;
427    
428                            _originalUserId = _userId;
429                    }
430    
431                    _userId = userId;
432            }
433    
434            public String getUserUuid() throws SystemException {
435                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
436            }
437    
438            public void setUserUuid(String userUuid) {
439                    _userUuid = userUuid;
440            }
441    
442            public long getOriginalUserId() {
443                    return _originalUserId;
444            }
445    
446            @JSON
447            public String getUserName() {
448                    if (_userName == null) {
449                            return StringPool.BLANK;
450                    }
451                    else {
452                            return _userName;
453                    }
454            }
455    
456            public void setUserName(String userName) {
457                    _userName = userName;
458            }
459    
460            @JSON
461            public Date getCreateDate() {
462                    return _createDate;
463            }
464    
465            public void setCreateDate(Date createDate) {
466                    _createDate = createDate;
467            }
468    
469            @JSON
470            public Date getModifiedDate() {
471                    return _modifiedDate;
472            }
473    
474            public void setModifiedDate(Date modifiedDate) {
475                    _modifiedDate = modifiedDate;
476            }
477    
478            @JSON
479            public long getResourceBlockId() {
480                    return _resourceBlockId;
481            }
482    
483            public void setResourceBlockId(long resourceBlockId) {
484                    _columnBitmask |= RESOURCEBLOCKID_COLUMN_BITMASK;
485    
486                    if (!_setOriginalResourceBlockId) {
487                            _setOriginalResourceBlockId = true;
488    
489                            _originalResourceBlockId = _resourceBlockId;
490                    }
491    
492                    _resourceBlockId = resourceBlockId;
493            }
494    
495            public long getOriginalResourceBlockId() {
496                    return _originalResourceBlockId;
497            }
498    
499            @JSON
500            public long getFolderId() {
501                    return _folderId;
502            }
503    
504            public void setFolderId(long folderId) {
505                    _columnBitmask = -1L;
506    
507                    if (!_setOriginalFolderId) {
508                            _setOriginalFolderId = true;
509    
510                            _originalFolderId = _folderId;
511                    }
512    
513                    _folderId = folderId;
514            }
515    
516            public long getOriginalFolderId() {
517                    return _originalFolderId;
518            }
519    
520            @JSON
521            public String getName() {
522                    if (_name == null) {
523                            return StringPool.BLANK;
524                    }
525                    else {
526                            return _name;
527                    }
528            }
529    
530            public void setName(String name) {
531                    _columnBitmask = -1L;
532    
533                    _name = name;
534            }
535    
536            @JSON
537            public String getUrl() {
538                    if (_url == null) {
539                            return StringPool.BLANK;
540                    }
541                    else {
542                            return _url;
543                    }
544            }
545    
546            public void setUrl(String url) {
547                    _url = url;
548            }
549    
550            @JSON
551            public String getDescription() {
552                    if (_description == null) {
553                            return StringPool.BLANK;
554                    }
555                    else {
556                            return _description;
557                    }
558            }
559    
560            public void setDescription(String description) {
561                    _description = description;
562            }
563    
564            @JSON
565            public int getVisits() {
566                    return _visits;
567            }
568    
569            public void setVisits(int visits) {
570                    _visits = visits;
571            }
572    
573            @JSON
574            public int getPriority() {
575                    return _priority;
576            }
577    
578            public void setPriority(int priority) {
579                    _priority = priority;
580            }
581    
582            @JSON
583            public int getStatus() {
584                    return _status;
585            }
586    
587            public void setStatus(int status) {
588                    _columnBitmask |= STATUS_COLUMN_BITMASK;
589    
590                    if (!_setOriginalStatus) {
591                            _setOriginalStatus = true;
592    
593                            _originalStatus = _status;
594                    }
595    
596                    _status = status;
597            }
598    
599            public int getOriginalStatus() {
600                    return _originalStatus;
601            }
602    
603            @JSON
604            public long getStatusByUserId() {
605                    return _statusByUserId;
606            }
607    
608            public void setStatusByUserId(long statusByUserId) {
609                    _statusByUserId = statusByUserId;
610            }
611    
612            public String getStatusByUserUuid() throws SystemException {
613                    return PortalUtil.getUserValue(getStatusByUserId(), "uuid",
614                            _statusByUserUuid);
615            }
616    
617            public void setStatusByUserUuid(String statusByUserUuid) {
618                    _statusByUserUuid = statusByUserUuid;
619            }
620    
621            @JSON
622            public String getStatusByUserName() {
623                    if (_statusByUserName == null) {
624                            return StringPool.BLANK;
625                    }
626                    else {
627                            return _statusByUserName;
628                    }
629            }
630    
631            public void setStatusByUserName(String statusByUserName) {
632                    _statusByUserName = statusByUserName;
633            }
634    
635            @JSON
636            public Date getStatusDate() {
637                    return _statusDate;
638            }
639    
640            public void setStatusDate(Date statusDate) {
641                    _statusDate = statusDate;
642            }
643    
644            /**
645             * @deprecated {@link #isApproved}
646             */
647            public boolean getApproved() {
648                    return isApproved();
649            }
650    
651            public boolean isApproved() {
652                    if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
653                            return true;
654                    }
655                    else {
656                            return false;
657                    }
658            }
659    
660            public boolean isDenied() {
661                    if (getStatus() == WorkflowConstants.STATUS_DENIED) {
662                            return true;
663                    }
664                    else {
665                            return false;
666                    }
667            }
668    
669            public boolean isDraft() {
670                    if (getStatus() == WorkflowConstants.STATUS_DRAFT) {
671                            return true;
672                    }
673                    else {
674                            return false;
675                    }
676            }
677    
678            public boolean isExpired() {
679                    if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
680                            return true;
681                    }
682                    else {
683                            return false;
684                    }
685            }
686    
687            public boolean isInactive() {
688                    if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
689                            return true;
690                    }
691                    else {
692                            return false;
693                    }
694            }
695    
696            public boolean isIncomplete() {
697                    if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
698                            return true;
699                    }
700                    else {
701                            return false;
702                    }
703            }
704    
705            public boolean isInTrash() {
706                    if (getStatus() == WorkflowConstants.STATUS_IN_TRASH) {
707                            return true;
708                    }
709                    else {
710                            return false;
711                    }
712            }
713    
714            public boolean isPending() {
715                    if (getStatus() == WorkflowConstants.STATUS_PENDING) {
716                            return true;
717                    }
718                    else {
719                            return false;
720                    }
721            }
722    
723            public boolean isScheduled() {
724                    if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
725                            return true;
726                    }
727                    else {
728                            return false;
729                    }
730            }
731    
732            public long getColumnBitmask() {
733                    return _columnBitmask;
734            }
735    
736            @Override
737            public ExpandoBridge getExpandoBridge() {
738                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
739                            BookmarksEntry.class.getName(), getPrimaryKey());
740            }
741    
742            @Override
743            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
744                    ExpandoBridge expandoBridge = getExpandoBridge();
745    
746                    expandoBridge.setAttributes(serviceContext);
747            }
748    
749            @Override
750            public BookmarksEntry toEscapedModel() {
751                    if (_escapedModel == null) {
752                            _escapedModel = (BookmarksEntry)ProxyUtil.newProxyInstance(_classLoader,
753                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
754                    }
755    
756                    return _escapedModel;
757            }
758    
759            @Override
760            public Object clone() {
761                    BookmarksEntryImpl bookmarksEntryImpl = new BookmarksEntryImpl();
762    
763                    bookmarksEntryImpl.setUuid(getUuid());
764                    bookmarksEntryImpl.setEntryId(getEntryId());
765                    bookmarksEntryImpl.setGroupId(getGroupId());
766                    bookmarksEntryImpl.setCompanyId(getCompanyId());
767                    bookmarksEntryImpl.setUserId(getUserId());
768                    bookmarksEntryImpl.setUserName(getUserName());
769                    bookmarksEntryImpl.setCreateDate(getCreateDate());
770                    bookmarksEntryImpl.setModifiedDate(getModifiedDate());
771                    bookmarksEntryImpl.setResourceBlockId(getResourceBlockId());
772                    bookmarksEntryImpl.setFolderId(getFolderId());
773                    bookmarksEntryImpl.setName(getName());
774                    bookmarksEntryImpl.setUrl(getUrl());
775                    bookmarksEntryImpl.setDescription(getDescription());
776                    bookmarksEntryImpl.setVisits(getVisits());
777                    bookmarksEntryImpl.setPriority(getPriority());
778                    bookmarksEntryImpl.setStatus(getStatus());
779                    bookmarksEntryImpl.setStatusByUserId(getStatusByUserId());
780                    bookmarksEntryImpl.setStatusByUserName(getStatusByUserName());
781                    bookmarksEntryImpl.setStatusDate(getStatusDate());
782    
783                    bookmarksEntryImpl.resetOriginalValues();
784    
785                    return bookmarksEntryImpl;
786            }
787    
788            public int compareTo(BookmarksEntry bookmarksEntry) {
789                    int value = 0;
790    
791                    if (getFolderId() < bookmarksEntry.getFolderId()) {
792                            value = -1;
793                    }
794                    else if (getFolderId() > bookmarksEntry.getFolderId()) {
795                            value = 1;
796                    }
797                    else {
798                            value = 0;
799                    }
800    
801                    if (value != 0) {
802                            return value;
803                    }
804    
805                    value = getName().compareToIgnoreCase(bookmarksEntry.getName());
806    
807                    if (value != 0) {
808                            return value;
809                    }
810    
811                    return 0;
812            }
813    
814            @Override
815            public boolean equals(Object obj) {
816                    if (obj == null) {
817                            return false;
818                    }
819    
820                    BookmarksEntry bookmarksEntry = null;
821    
822                    try {
823                            bookmarksEntry = (BookmarksEntry)obj;
824                    }
825                    catch (ClassCastException cce) {
826                            return false;
827                    }
828    
829                    long primaryKey = bookmarksEntry.getPrimaryKey();
830    
831                    if (getPrimaryKey() == primaryKey) {
832                            return true;
833                    }
834                    else {
835                            return false;
836                    }
837            }
838    
839            @Override
840            public int hashCode() {
841                    return (int)getPrimaryKey();
842            }
843    
844            @Override
845            public void resetOriginalValues() {
846                    BookmarksEntryModelImpl bookmarksEntryModelImpl = this;
847    
848                    bookmarksEntryModelImpl._originalUuid = bookmarksEntryModelImpl._uuid;
849    
850                    bookmarksEntryModelImpl._originalGroupId = bookmarksEntryModelImpl._groupId;
851    
852                    bookmarksEntryModelImpl._setOriginalGroupId = false;
853    
854                    bookmarksEntryModelImpl._originalCompanyId = bookmarksEntryModelImpl._companyId;
855    
856                    bookmarksEntryModelImpl._setOriginalCompanyId = false;
857    
858                    bookmarksEntryModelImpl._originalUserId = bookmarksEntryModelImpl._userId;
859    
860                    bookmarksEntryModelImpl._setOriginalUserId = false;
861    
862                    bookmarksEntryModelImpl._originalResourceBlockId = bookmarksEntryModelImpl._resourceBlockId;
863    
864                    bookmarksEntryModelImpl._setOriginalResourceBlockId = false;
865    
866                    bookmarksEntryModelImpl._originalFolderId = bookmarksEntryModelImpl._folderId;
867    
868                    bookmarksEntryModelImpl._setOriginalFolderId = false;
869    
870                    bookmarksEntryModelImpl._originalStatus = bookmarksEntryModelImpl._status;
871    
872                    bookmarksEntryModelImpl._setOriginalStatus = false;
873    
874                    bookmarksEntryModelImpl._columnBitmask = 0;
875            }
876    
877            @Override
878            public CacheModel<BookmarksEntry> toCacheModel() {
879                    BookmarksEntryCacheModel bookmarksEntryCacheModel = new BookmarksEntryCacheModel();
880    
881                    bookmarksEntryCacheModel.uuid = getUuid();
882    
883                    String uuid = bookmarksEntryCacheModel.uuid;
884    
885                    if ((uuid != null) && (uuid.length() == 0)) {
886                            bookmarksEntryCacheModel.uuid = null;
887                    }
888    
889                    bookmarksEntryCacheModel.entryId = getEntryId();
890    
891                    bookmarksEntryCacheModel.groupId = getGroupId();
892    
893                    bookmarksEntryCacheModel.companyId = getCompanyId();
894    
895                    bookmarksEntryCacheModel.userId = getUserId();
896    
897                    bookmarksEntryCacheModel.userName = getUserName();
898    
899                    String userName = bookmarksEntryCacheModel.userName;
900    
901                    if ((userName != null) && (userName.length() == 0)) {
902                            bookmarksEntryCacheModel.userName = null;
903                    }
904    
905                    Date createDate = getCreateDate();
906    
907                    if (createDate != null) {
908                            bookmarksEntryCacheModel.createDate = createDate.getTime();
909                    }
910                    else {
911                            bookmarksEntryCacheModel.createDate = Long.MIN_VALUE;
912                    }
913    
914                    Date modifiedDate = getModifiedDate();
915    
916                    if (modifiedDate != null) {
917                            bookmarksEntryCacheModel.modifiedDate = modifiedDate.getTime();
918                    }
919                    else {
920                            bookmarksEntryCacheModel.modifiedDate = Long.MIN_VALUE;
921                    }
922    
923                    bookmarksEntryCacheModel.resourceBlockId = getResourceBlockId();
924    
925                    bookmarksEntryCacheModel.folderId = getFolderId();
926    
927                    bookmarksEntryCacheModel.name = getName();
928    
929                    String name = bookmarksEntryCacheModel.name;
930    
931                    if ((name != null) && (name.length() == 0)) {
932                            bookmarksEntryCacheModel.name = null;
933                    }
934    
935                    bookmarksEntryCacheModel.url = getUrl();
936    
937                    String url = bookmarksEntryCacheModel.url;
938    
939                    if ((url != null) && (url.length() == 0)) {
940                            bookmarksEntryCacheModel.url = null;
941                    }
942    
943                    bookmarksEntryCacheModel.description = getDescription();
944    
945                    String description = bookmarksEntryCacheModel.description;
946    
947                    if ((description != null) && (description.length() == 0)) {
948                            bookmarksEntryCacheModel.description = null;
949                    }
950    
951                    bookmarksEntryCacheModel.visits = getVisits();
952    
953                    bookmarksEntryCacheModel.priority = getPriority();
954    
955                    bookmarksEntryCacheModel.status = getStatus();
956    
957                    bookmarksEntryCacheModel.statusByUserId = getStatusByUserId();
958    
959                    bookmarksEntryCacheModel.statusByUserName = getStatusByUserName();
960    
961                    String statusByUserName = bookmarksEntryCacheModel.statusByUserName;
962    
963                    if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
964                            bookmarksEntryCacheModel.statusByUserName = null;
965                    }
966    
967                    Date statusDate = getStatusDate();
968    
969                    if (statusDate != null) {
970                            bookmarksEntryCacheModel.statusDate = statusDate.getTime();
971                    }
972                    else {
973                            bookmarksEntryCacheModel.statusDate = Long.MIN_VALUE;
974                    }
975    
976                    return bookmarksEntryCacheModel;
977            }
978    
979            @Override
980            public String toString() {
981                    StringBundler sb = new StringBundler(39);
982    
983                    sb.append("{uuid=");
984                    sb.append(getUuid());
985                    sb.append(", entryId=");
986                    sb.append(getEntryId());
987                    sb.append(", groupId=");
988                    sb.append(getGroupId());
989                    sb.append(", companyId=");
990                    sb.append(getCompanyId());
991                    sb.append(", userId=");
992                    sb.append(getUserId());
993                    sb.append(", userName=");
994                    sb.append(getUserName());
995                    sb.append(", createDate=");
996                    sb.append(getCreateDate());
997                    sb.append(", modifiedDate=");
998                    sb.append(getModifiedDate());
999                    sb.append(", resourceBlockId=");
1000                    sb.append(getResourceBlockId());
1001                    sb.append(", folderId=");
1002                    sb.append(getFolderId());
1003                    sb.append(", name=");
1004                    sb.append(getName());
1005                    sb.append(", url=");
1006                    sb.append(getUrl());
1007                    sb.append(", description=");
1008                    sb.append(getDescription());
1009                    sb.append(", visits=");
1010                    sb.append(getVisits());
1011                    sb.append(", priority=");
1012                    sb.append(getPriority());
1013                    sb.append(", status=");
1014                    sb.append(getStatus());
1015                    sb.append(", statusByUserId=");
1016                    sb.append(getStatusByUserId());
1017                    sb.append(", statusByUserName=");
1018                    sb.append(getStatusByUserName());
1019                    sb.append(", statusDate=");
1020                    sb.append(getStatusDate());
1021                    sb.append("}");
1022    
1023                    return sb.toString();
1024            }
1025    
1026            public String toXmlString() {
1027                    StringBundler sb = new StringBundler(61);
1028    
1029                    sb.append("<model><model-name>");
1030                    sb.append("com.liferay.portlet.bookmarks.model.BookmarksEntry");
1031                    sb.append("</model-name>");
1032    
1033                    sb.append(
1034                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
1035                    sb.append(getUuid());
1036                    sb.append("]]></column-value></column>");
1037                    sb.append(
1038                            "<column><column-name>entryId</column-name><column-value><![CDATA[");
1039                    sb.append(getEntryId());
1040                    sb.append("]]></column-value></column>");
1041                    sb.append(
1042                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1043                    sb.append(getGroupId());
1044                    sb.append("]]></column-value></column>");
1045                    sb.append(
1046                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1047                    sb.append(getCompanyId());
1048                    sb.append("]]></column-value></column>");
1049                    sb.append(
1050                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1051                    sb.append(getUserId());
1052                    sb.append("]]></column-value></column>");
1053                    sb.append(
1054                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1055                    sb.append(getUserName());
1056                    sb.append("]]></column-value></column>");
1057                    sb.append(
1058                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1059                    sb.append(getCreateDate());
1060                    sb.append("]]></column-value></column>");
1061                    sb.append(
1062                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1063                    sb.append(getModifiedDate());
1064                    sb.append("]]></column-value></column>");
1065                    sb.append(
1066                            "<column><column-name>resourceBlockId</column-name><column-value><![CDATA[");
1067                    sb.append(getResourceBlockId());
1068                    sb.append("]]></column-value></column>");
1069                    sb.append(
1070                            "<column><column-name>folderId</column-name><column-value><![CDATA[");
1071                    sb.append(getFolderId());
1072                    sb.append("]]></column-value></column>");
1073                    sb.append(
1074                            "<column><column-name>name</column-name><column-value><![CDATA[");
1075                    sb.append(getName());
1076                    sb.append("]]></column-value></column>");
1077                    sb.append(
1078                            "<column><column-name>url</column-name><column-value><![CDATA[");
1079                    sb.append(getUrl());
1080                    sb.append("]]></column-value></column>");
1081                    sb.append(
1082                            "<column><column-name>description</column-name><column-value><![CDATA[");
1083                    sb.append(getDescription());
1084                    sb.append("]]></column-value></column>");
1085                    sb.append(
1086                            "<column><column-name>visits</column-name><column-value><![CDATA[");
1087                    sb.append(getVisits());
1088                    sb.append("]]></column-value></column>");
1089                    sb.append(
1090                            "<column><column-name>priority</column-name><column-value><![CDATA[");
1091                    sb.append(getPriority());
1092                    sb.append("]]></column-value></column>");
1093                    sb.append(
1094                            "<column><column-name>status</column-name><column-value><![CDATA[");
1095                    sb.append(getStatus());
1096                    sb.append("]]></column-value></column>");
1097                    sb.append(
1098                            "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
1099                    sb.append(getStatusByUserId());
1100                    sb.append("]]></column-value></column>");
1101                    sb.append(
1102                            "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
1103                    sb.append(getStatusByUserName());
1104                    sb.append("]]></column-value></column>");
1105                    sb.append(
1106                            "<column><column-name>statusDate</column-name><column-value><![CDATA[");
1107                    sb.append(getStatusDate());
1108                    sb.append("]]></column-value></column>");
1109    
1110                    sb.append("</model>");
1111    
1112                    return sb.toString();
1113            }
1114    
1115            private static ClassLoader _classLoader = BookmarksEntry.class.getClassLoader();
1116            private static Class<?>[] _escapedModelInterfaces = new Class[] {
1117                            BookmarksEntry.class
1118                    };
1119            private String _uuid;
1120            private String _originalUuid;
1121            private long _entryId;
1122            private long _groupId;
1123            private long _originalGroupId;
1124            private boolean _setOriginalGroupId;
1125            private long _companyId;
1126            private long _originalCompanyId;
1127            private boolean _setOriginalCompanyId;
1128            private long _userId;
1129            private String _userUuid;
1130            private long _originalUserId;
1131            private boolean _setOriginalUserId;
1132            private String _userName;
1133            private Date _createDate;
1134            private Date _modifiedDate;
1135            private long _resourceBlockId;
1136            private long _originalResourceBlockId;
1137            private boolean _setOriginalResourceBlockId;
1138            private long _folderId;
1139            private long _originalFolderId;
1140            private boolean _setOriginalFolderId;
1141            private String _name;
1142            private String _url;
1143            private String _description;
1144            private int _visits;
1145            private int _priority;
1146            private int _status;
1147            private int _originalStatus;
1148            private boolean _setOriginalStatus;
1149            private long _statusByUserId;
1150            private String _statusByUserUuid;
1151            private String _statusByUserName;
1152            private Date _statusDate;
1153            private long _columnBitmask;
1154            private BookmarksEntry _escapedModel;
1155    }