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