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            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().toLowerCase()
699                                            .compareTo(wikiNode.getName().toLowerCase());
700    
701                    if (value != 0) {
702                            return value;
703                    }
704    
705                    return 0;
706            }
707    
708            @Override
709            public boolean equals(Object obj) {
710                    if (obj == null) {
711                            return false;
712                    }
713    
714                    WikiNode wikiNode = null;
715    
716                    try {
717                            wikiNode = (WikiNode)obj;
718                    }
719                    catch (ClassCastException cce) {
720                            return false;
721                    }
722    
723                    long primaryKey = wikiNode.getPrimaryKey();
724    
725                    if (getPrimaryKey() == primaryKey) {
726                            return true;
727                    }
728                    else {
729                            return false;
730                    }
731            }
732    
733            @Override
734            public int hashCode() {
735                    return (int)getPrimaryKey();
736            }
737    
738            @Override
739            public void resetOriginalValues() {
740                    WikiNodeModelImpl wikiNodeModelImpl = this;
741    
742                    wikiNodeModelImpl._originalUuid = wikiNodeModelImpl._uuid;
743    
744                    wikiNodeModelImpl._originalGroupId = wikiNodeModelImpl._groupId;
745    
746                    wikiNodeModelImpl._setOriginalGroupId = false;
747    
748                    wikiNodeModelImpl._originalCompanyId = wikiNodeModelImpl._companyId;
749    
750                    wikiNodeModelImpl._setOriginalCompanyId = false;
751    
752                    wikiNodeModelImpl._originalName = wikiNodeModelImpl._name;
753    
754                    wikiNodeModelImpl._originalStatus = wikiNodeModelImpl._status;
755    
756                    wikiNodeModelImpl._setOriginalStatus = false;
757    
758                    wikiNodeModelImpl._columnBitmask = 0;
759            }
760    
761            @Override
762            public CacheModel<WikiNode> toCacheModel() {
763                    WikiNodeCacheModel wikiNodeCacheModel = new WikiNodeCacheModel();
764    
765                    wikiNodeCacheModel.uuid = getUuid();
766    
767                    String uuid = wikiNodeCacheModel.uuid;
768    
769                    if ((uuid != null) && (uuid.length() == 0)) {
770                            wikiNodeCacheModel.uuid = null;
771                    }
772    
773                    wikiNodeCacheModel.nodeId = getNodeId();
774    
775                    wikiNodeCacheModel.groupId = getGroupId();
776    
777                    wikiNodeCacheModel.companyId = getCompanyId();
778    
779                    wikiNodeCacheModel.userId = getUserId();
780    
781                    wikiNodeCacheModel.userName = getUserName();
782    
783                    String userName = wikiNodeCacheModel.userName;
784    
785                    if ((userName != null) && (userName.length() == 0)) {
786                            wikiNodeCacheModel.userName = null;
787                    }
788    
789                    Date createDate = getCreateDate();
790    
791                    if (createDate != null) {
792                            wikiNodeCacheModel.createDate = createDate.getTime();
793                    }
794                    else {
795                            wikiNodeCacheModel.createDate = Long.MIN_VALUE;
796                    }
797    
798                    Date modifiedDate = getModifiedDate();
799    
800                    if (modifiedDate != null) {
801                            wikiNodeCacheModel.modifiedDate = modifiedDate.getTime();
802                    }
803                    else {
804                            wikiNodeCacheModel.modifiedDate = Long.MIN_VALUE;
805                    }
806    
807                    wikiNodeCacheModel.name = getName();
808    
809                    String name = wikiNodeCacheModel.name;
810    
811                    if ((name != null) && (name.length() == 0)) {
812                            wikiNodeCacheModel.name = null;
813                    }
814    
815                    wikiNodeCacheModel.description = getDescription();
816    
817                    String description = wikiNodeCacheModel.description;
818    
819                    if ((description != null) && (description.length() == 0)) {
820                            wikiNodeCacheModel.description = null;
821                    }
822    
823                    Date lastPostDate = getLastPostDate();
824    
825                    if (lastPostDate != null) {
826                            wikiNodeCacheModel.lastPostDate = lastPostDate.getTime();
827                    }
828                    else {
829                            wikiNodeCacheModel.lastPostDate = Long.MIN_VALUE;
830                    }
831    
832                    wikiNodeCacheModel.status = getStatus();
833    
834                    wikiNodeCacheModel.statusByUserId = getStatusByUserId();
835    
836                    wikiNodeCacheModel.statusByUserName = getStatusByUserName();
837    
838                    String statusByUserName = wikiNodeCacheModel.statusByUserName;
839    
840                    if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
841                            wikiNodeCacheModel.statusByUserName = null;
842                    }
843    
844                    Date statusDate = getStatusDate();
845    
846                    if (statusDate != null) {
847                            wikiNodeCacheModel.statusDate = statusDate.getTime();
848                    }
849                    else {
850                            wikiNodeCacheModel.statusDate = Long.MIN_VALUE;
851                    }
852    
853                    return wikiNodeCacheModel;
854            }
855    
856            @Override
857            public String toString() {
858                    StringBundler sb = new StringBundler(31);
859    
860                    sb.append("{uuid=");
861                    sb.append(getUuid());
862                    sb.append(", nodeId=");
863                    sb.append(getNodeId());
864                    sb.append(", groupId=");
865                    sb.append(getGroupId());
866                    sb.append(", companyId=");
867                    sb.append(getCompanyId());
868                    sb.append(", userId=");
869                    sb.append(getUserId());
870                    sb.append(", userName=");
871                    sb.append(getUserName());
872                    sb.append(", createDate=");
873                    sb.append(getCreateDate());
874                    sb.append(", modifiedDate=");
875                    sb.append(getModifiedDate());
876                    sb.append(", name=");
877                    sb.append(getName());
878                    sb.append(", description=");
879                    sb.append(getDescription());
880                    sb.append(", lastPostDate=");
881                    sb.append(getLastPostDate());
882                    sb.append(", status=");
883                    sb.append(getStatus());
884                    sb.append(", statusByUserId=");
885                    sb.append(getStatusByUserId());
886                    sb.append(", statusByUserName=");
887                    sb.append(getStatusByUserName());
888                    sb.append(", statusDate=");
889                    sb.append(getStatusDate());
890                    sb.append("}");
891    
892                    return sb.toString();
893            }
894    
895            public String toXmlString() {
896                    StringBundler sb = new StringBundler(49);
897    
898                    sb.append("<model><model-name>");
899                    sb.append("com.liferay.portlet.wiki.model.WikiNode");
900                    sb.append("</model-name>");
901    
902                    sb.append(
903                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
904                    sb.append(getUuid());
905                    sb.append("]]></column-value></column>");
906                    sb.append(
907                            "<column><column-name>nodeId</column-name><column-value><![CDATA[");
908                    sb.append(getNodeId());
909                    sb.append("]]></column-value></column>");
910                    sb.append(
911                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
912                    sb.append(getGroupId());
913                    sb.append("]]></column-value></column>");
914                    sb.append(
915                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
916                    sb.append(getCompanyId());
917                    sb.append("]]></column-value></column>");
918                    sb.append(
919                            "<column><column-name>userId</column-name><column-value><![CDATA[");
920                    sb.append(getUserId());
921                    sb.append("]]></column-value></column>");
922                    sb.append(
923                            "<column><column-name>userName</column-name><column-value><![CDATA[");
924                    sb.append(getUserName());
925                    sb.append("]]></column-value></column>");
926                    sb.append(
927                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
928                    sb.append(getCreateDate());
929                    sb.append("]]></column-value></column>");
930                    sb.append(
931                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
932                    sb.append(getModifiedDate());
933                    sb.append("]]></column-value></column>");
934                    sb.append(
935                            "<column><column-name>name</column-name><column-value><![CDATA[");
936                    sb.append(getName());
937                    sb.append("]]></column-value></column>");
938                    sb.append(
939                            "<column><column-name>description</column-name><column-value><![CDATA[");
940                    sb.append(getDescription());
941                    sb.append("]]></column-value></column>");
942                    sb.append(
943                            "<column><column-name>lastPostDate</column-name><column-value><![CDATA[");
944                    sb.append(getLastPostDate());
945                    sb.append("]]></column-value></column>");
946                    sb.append(
947                            "<column><column-name>status</column-name><column-value><![CDATA[");
948                    sb.append(getStatus());
949                    sb.append("]]></column-value></column>");
950                    sb.append(
951                            "<column><column-name>statusByUserId</column-name><column-value><![CDATA[");
952                    sb.append(getStatusByUserId());
953                    sb.append("]]></column-value></column>");
954                    sb.append(
955                            "<column><column-name>statusByUserName</column-name><column-value><![CDATA[");
956                    sb.append(getStatusByUserName());
957                    sb.append("]]></column-value></column>");
958                    sb.append(
959                            "<column><column-name>statusDate</column-name><column-value><![CDATA[");
960                    sb.append(getStatusDate());
961                    sb.append("]]></column-value></column>");
962    
963                    sb.append("</model>");
964    
965                    return sb.toString();
966            }
967    
968            private static ClassLoader _classLoader = WikiNode.class.getClassLoader();
969            private static Class<?>[] _escapedModelInterfaces = new Class[] {
970                            WikiNode.class
971                    };
972            private String _uuid;
973            private String _originalUuid;
974            private long _nodeId;
975            private long _groupId;
976            private long _originalGroupId;
977            private boolean _setOriginalGroupId;
978            private long _companyId;
979            private long _originalCompanyId;
980            private boolean _setOriginalCompanyId;
981            private long _userId;
982            private String _userUuid;
983            private String _userName;
984            private Date _createDate;
985            private Date _modifiedDate;
986            private String _name;
987            private String _originalName;
988            private String _description;
989            private Date _lastPostDate;
990            private int _status;
991            private int _originalStatus;
992            private boolean _setOriginalStatus;
993            private long _statusByUserId;
994            private String _statusByUserUuid;
995            private String _statusByUserName;
996            private Date _statusDate;
997            private long _columnBitmask;
998            private WikiNode _escapedModel;
999    }