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 new Long(_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            /**
537             * @deprecated {@link #isApproved}
538             */
539            public boolean getApproved() {
540                    return isApproved();
541            }
542    
543            public boolean isApproved() {
544                    if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
545                            return true;
546                    }
547                    else {
548                            return false;
549                    }
550            }
551    
552            public boolean isDenied() {
553                    if (getStatus() == WorkflowConstants.STATUS_DENIED) {
554                            return true;
555                    }
556                    else {
557                            return false;
558                    }
559            }
560    
561            public boolean isDraft() {
562                    if (getStatus() == WorkflowConstants.STATUS_DRAFT) {
563                            return true;
564                    }
565                    else {
566                            return false;
567                    }
568            }
569    
570            public boolean isExpired() {
571                    if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
572                            return true;
573                    }
574                    else {
575                            return false;
576                    }
577            }
578    
579            public boolean isInactive() {
580                    if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
581                            return true;
582                    }
583                    else {
584                            return false;
585                    }
586            }
587    
588            public boolean isIncomplete() {
589                    if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
590                            return true;
591                    }
592                    else {
593                            return false;
594                    }
595            }
596    
597            public boolean isInTrash() {
598                    if (getStatus() == WorkflowConstants.STATUS_IN_TRASH) {
599                            return true;
600                    }
601                    else {
602                            return false;
603                    }
604            }
605    
606            public boolean isPending() {
607                    if (getStatus() == WorkflowConstants.STATUS_PENDING) {
608                            return true;
609                    }
610                    else {
611                            return false;
612                    }
613            }
614    
615            public boolean isScheduled() {
616                    if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
617                            return true;
618                    }
619                    else {
620                            return false;
621                    }
622            }
623    
624            public long getColumnBitmask() {
625                    return _columnBitmask;
626            }
627    
628            @Override
629            public ExpandoBridge getExpandoBridge() {
630                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
631                            WikiNode.class.getName(), getPrimaryKey());
632            }
633    
634            @Override
635            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
636                    ExpandoBridge expandoBridge = getExpandoBridge();
637    
638                    expandoBridge.setAttributes(serviceContext);
639            }
640    
641            @Override
642            public WikiNode toEscapedModel() {
643                    if (_escapedModelProxy == null) {
644                            _escapedModelProxy = (WikiNode)ProxyUtil.newProxyInstance(_classLoader,
645                                            _escapedModelProxyInterfaces,
646                                            new AutoEscapeBeanHandler(this));
647                    }
648    
649                    return _escapedModelProxy;
650            }
651    
652            @Override
653            public Object clone() {
654                    WikiNodeImpl wikiNodeImpl = new WikiNodeImpl();
655    
656                    wikiNodeImpl.setUuid(getUuid());
657                    wikiNodeImpl.setNodeId(getNodeId());
658                    wikiNodeImpl.setGroupId(getGroupId());
659                    wikiNodeImpl.setCompanyId(getCompanyId());
660                    wikiNodeImpl.setUserId(getUserId());
661                    wikiNodeImpl.setUserName(getUserName());
662                    wikiNodeImpl.setCreateDate(getCreateDate());
663                    wikiNodeImpl.setModifiedDate(getModifiedDate());
664                    wikiNodeImpl.setName(getName());
665                    wikiNodeImpl.setDescription(getDescription());
666                    wikiNodeImpl.setLastPostDate(getLastPostDate());
667                    wikiNodeImpl.setStatus(getStatus());
668                    wikiNodeImpl.setStatusByUserId(getStatusByUserId());
669                    wikiNodeImpl.setStatusByUserName(getStatusByUserName());
670                    wikiNodeImpl.setStatusDate(getStatusDate());
671    
672                    wikiNodeImpl.resetOriginalValues();
673    
674                    return wikiNodeImpl;
675            }
676    
677            public int compareTo(WikiNode wikiNode) {
678                    int value = 0;
679    
680                    value = getName().toLowerCase()
681                                            .compareTo(wikiNode.getName().toLowerCase());
682    
683                    if (value != 0) {
684                            return value;
685                    }
686    
687                    return 0;
688            }
689    
690            @Override
691            public boolean equals(Object obj) {
692                    if (obj == null) {
693                            return false;
694                    }
695    
696                    WikiNode wikiNode = null;
697    
698                    try {
699                            wikiNode = (WikiNode)obj;
700                    }
701                    catch (ClassCastException cce) {
702                            return false;
703                    }
704    
705                    long primaryKey = wikiNode.getPrimaryKey();
706    
707                    if (getPrimaryKey() == primaryKey) {
708                            return true;
709                    }
710                    else {
711                            return false;
712                    }
713            }
714    
715            @Override
716            public int hashCode() {
717                    return (int)getPrimaryKey();
718            }
719    
720            @Override
721            public void resetOriginalValues() {
722                    WikiNodeModelImpl wikiNodeModelImpl = this;
723    
724                    wikiNodeModelImpl._originalUuid = wikiNodeModelImpl._uuid;
725    
726                    wikiNodeModelImpl._originalGroupId = wikiNodeModelImpl._groupId;
727    
728                    wikiNodeModelImpl._setOriginalGroupId = false;
729    
730                    wikiNodeModelImpl._originalCompanyId = wikiNodeModelImpl._companyId;
731    
732                    wikiNodeModelImpl._setOriginalCompanyId = false;
733    
734                    wikiNodeModelImpl._originalName = wikiNodeModelImpl._name;
735    
736                    wikiNodeModelImpl._originalStatus = wikiNodeModelImpl._status;
737    
738                    wikiNodeModelImpl._setOriginalStatus = false;
739    
740                    wikiNodeModelImpl._columnBitmask = 0;
741            }
742    
743            @Override
744            public CacheModel<WikiNode> toCacheModel() {
745                    WikiNodeCacheModel wikiNodeCacheModel = new WikiNodeCacheModel();
746    
747                    wikiNodeCacheModel.uuid = getUuid();
748    
749                    String uuid = wikiNodeCacheModel.uuid;
750    
751                    if ((uuid != null) && (uuid.length() == 0)) {
752                            wikiNodeCacheModel.uuid = null;
753                    }
754    
755                    wikiNodeCacheModel.nodeId = getNodeId();
756    
757                    wikiNodeCacheModel.groupId = getGroupId();
758    
759                    wikiNodeCacheModel.companyId = getCompanyId();
760    
761                    wikiNodeCacheModel.userId = getUserId();
762    
763                    wikiNodeCacheModel.userName = getUserName();
764    
765                    String userName = wikiNodeCacheModel.userName;
766    
767                    if ((userName != null) && (userName.length() == 0)) {
768                            wikiNodeCacheModel.userName = null;
769                    }
770    
771                    Date createDate = getCreateDate();
772    
773                    if (createDate != null) {
774                            wikiNodeCacheModel.createDate = createDate.getTime();
775                    }
776                    else {
777                            wikiNodeCacheModel.createDate = Long.MIN_VALUE;
778                    }
779    
780                    Date modifiedDate = getModifiedDate();
781    
782                    if (modifiedDate != null) {
783                            wikiNodeCacheModel.modifiedDate = modifiedDate.getTime();
784                    }
785                    else {
786                            wikiNodeCacheModel.modifiedDate = Long.MIN_VALUE;
787                    }
788    
789                    wikiNodeCacheModel.name = getName();
790    
791                    String name = wikiNodeCacheModel.name;
792    
793                    if ((name != null) && (name.length() == 0)) {
794                            wikiNodeCacheModel.name = null;
795                    }
796    
797                    wikiNodeCacheModel.description = getDescription();
798    
799                    String description = wikiNodeCacheModel.description;
800    
801                    if ((description != null) && (description.length() == 0)) {
802                            wikiNodeCacheModel.description = null;
803                    }
804    
805                    Date lastPostDate = getLastPostDate();
806    
807                    if (lastPostDate != null) {
808                            wikiNodeCacheModel.lastPostDate = lastPostDate.getTime();
809                    }
810                    else {
811                            wikiNodeCacheModel.lastPostDate = Long.MIN_VALUE;
812                    }
813    
814                    wikiNodeCacheModel.status = getStatus();
815    
816                    wikiNodeCacheModel.statusByUserId = getStatusByUserId();
817    
818                    wikiNodeCacheModel.statusByUserName = getStatusByUserName();
819    
820                    String statusByUserName = wikiNodeCacheModel.statusByUserName;
821    
822                    if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
823                            wikiNodeCacheModel.statusByUserName = null;
824                    }
825    
826                    Date statusDate = getStatusDate();
827    
828                    if (statusDate != null) {
829                            wikiNodeCacheModel.statusDate = statusDate.getTime();
830                    }
831                    else {
832                            wikiNodeCacheModel.statusDate = Long.MIN_VALUE;
833                    }
834    
835                    return wikiNodeCacheModel;
836            }
837    
838            @Override
839            public String toString() {
840                    StringBundler sb = new StringBundler(31);
841    
842                    sb.append("{uuid=");
843                    sb.append(getUuid());
844                    sb.append(", nodeId=");
845                    sb.append(getNodeId());
846                    sb.append(", groupId=");
847                    sb.append(getGroupId());
848                    sb.append(", companyId=");
849                    sb.append(getCompanyId());
850                    sb.append(", userId=");
851                    sb.append(getUserId());
852                    sb.append(", userName=");
853                    sb.append(getUserName());
854                    sb.append(", createDate=");
855                    sb.append(getCreateDate());
856                    sb.append(", modifiedDate=");
857                    sb.append(getModifiedDate());
858                    sb.append(", name=");
859                    sb.append(getName());
860                    sb.append(", description=");
861                    sb.append(getDescription());
862                    sb.append(", lastPostDate=");
863                    sb.append(getLastPostDate());
864                    sb.append(", status=");
865                    sb.append(getStatus());
866                    sb.append(", statusByUserId=");
867                    sb.append(getStatusByUserId());
868                    sb.append(", statusByUserName=");
869                    sb.append(getStatusByUserName());
870                    sb.append(", statusDate=");
871                    sb.append(getStatusDate());
872                    sb.append("}");
873    
874                    return sb.toString();
875            }
876    
877            public String toXmlString() {
878                    StringBundler sb = new StringBundler(49);
879    
880                    sb.append("<model><model-name>");
881                    sb.append("com.liferay.portlet.wiki.model.WikiNode");
882                    sb.append("</model-name>");
883    
884                    sb.append(
885                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
886                    sb.append(getUuid());
887                    sb.append("]]></column-value></column>");
888                    sb.append(
889                            "<column><column-name>nodeId</column-name><column-value><![CDATA[");
890                    sb.append(getNodeId());
891                    sb.append("]]></column-value></column>");
892                    sb.append(
893                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
894                    sb.append(getGroupId());
895                    sb.append("]]></column-value></column>");
896                    sb.append(
897                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
898                    sb.append(getCompanyId());
899                    sb.append("]]></column-value></column>");
900                    sb.append(
901                            "<column><column-name>userId</column-name><column-value><![CDATA[");
902                    sb.append(getUserId());
903                    sb.append("]]></column-value></column>");
904                    sb.append(
905                            "<column><column-name>userName</column-name><column-value><![CDATA[");
906                    sb.append(getUserName());
907                    sb.append("]]></column-value></column>");
908                    sb.append(
909                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
910                    sb.append(getCreateDate());
911                    sb.append("]]></column-value></column>");
912                    sb.append(
913                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
914                    sb.append(getModifiedDate());
915                    sb.append("]]></column-value></column>");
916                    sb.append(
917                            "<column><column-name>name</column-name><column-value><![CDATA[");
918                    sb.append(getName());
919                    sb.append("]]></column-value></column>");
920                    sb.append(
921                            "<column><column-name>description</column-name><column-value><![CDATA[");
922                    sb.append(getDescription());
923                    sb.append("]]></column-value></column>");
924                    sb.append(
925                            "<column><column-name>lastPostDate</column-name><column-value><![CDATA[");
926                    sb.append(getLastPostDate());
927                    sb.append("]]></column-value></column>");
928                    sb.append(
929                            "<column><column-name>status</column-name><column-value><![CDATA[");
930                    sb.append(getStatus());
931                    sb.append("]]></column-value></column>");
932                    sb.append(
933                            "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
934                    sb.append(getStatusByUserId());
935                    sb.append("]]></column-value></column>");
936                    sb.append(
937                            "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
938                    sb.append(getStatusByUserName());
939                    sb.append("]]></column-value></column>");
940                    sb.append(
941                            "<column><column-name>statusDate</column-name><column-value><![CDATA[");
942                    sb.append(getStatusDate());
943                    sb.append("]]></column-value></column>");
944    
945                    sb.append("</model>");
946    
947                    return sb.toString();
948            }
949    
950            private static ClassLoader _classLoader = WikiNode.class.getClassLoader();
951            private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
952                            WikiNode.class
953                    };
954            private String _uuid;
955            private String _originalUuid;
956            private long _nodeId;
957            private long _groupId;
958            private long _originalGroupId;
959            private boolean _setOriginalGroupId;
960            private long _companyId;
961            private long _originalCompanyId;
962            private boolean _setOriginalCompanyId;
963            private long _userId;
964            private String _userUuid;
965            private String _userName;
966            private Date _createDate;
967            private Date _modifiedDate;
968            private String _name;
969            private String _originalName;
970            private String _description;
971            private Date _lastPostDate;
972            private int _status;
973            private int _originalStatus;
974            private boolean _setOriginalStatus;
975            private long _statusByUserId;
976            private String _statusByUserUuid;
977            private String _statusByUserName;
978            private Date _statusDate;
979            private long _columnBitmask;
980            private WikiNode _escapedModelProxy;
981    }