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