001    /**
002     * Copyright (c) 2000-present 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.portal.model.impl;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
020    import com.liferay.portal.kernel.exception.PortalException;
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.util.Validator;
026    import com.liferay.portal.model.CacheModel;
027    import com.liferay.portal.model.User;
028    import com.liferay.portal.model.WorkflowDefinitionLink;
029    import com.liferay.portal.model.WorkflowDefinitionLinkModel;
030    import com.liferay.portal.service.ServiceContext;
031    import com.liferay.portal.service.UserLocalServiceUtil;
032    import com.liferay.portal.util.PortalUtil;
033    
034    import com.liferay.portlet.expando.model.ExpandoBridge;
035    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
036    
037    import java.io.Serializable;
038    
039    import java.sql.Types;
040    
041    import java.util.Date;
042    import java.util.HashMap;
043    import java.util.Map;
044    
045    /**
046     * The base model implementation for the WorkflowDefinitionLink service. Represents a row in the "WorkflowDefinitionLink" database table, with each column mapped to a property of this class.
047     *
048     * <p>
049     * This implementation and its corresponding interface {@link WorkflowDefinitionLinkModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link WorkflowDefinitionLinkImpl}.
050     * </p>
051     *
052     * @author Brian Wing Shun Chan
053     * @see WorkflowDefinitionLinkImpl
054     * @see WorkflowDefinitionLink
055     * @see WorkflowDefinitionLinkModel
056     * @generated
057     */
058    @ProviderType
059    public class WorkflowDefinitionLinkModelImpl extends BaseModelImpl<WorkflowDefinitionLink>
060            implements WorkflowDefinitionLinkModel {
061            /*
062             * NOTE FOR DEVELOPERS:
063             *
064             * Never modify or reference this class directly. All methods that expect a workflow definition link model instance should use the {@link WorkflowDefinitionLink} interface instead.
065             */
066            public static final String TABLE_NAME = "WorkflowDefinitionLink";
067            public static final Object[][] TABLE_COLUMNS = {
068                            { "mvccVersion", Types.BIGINT },
069                            { "workflowDefinitionLinkId", Types.BIGINT },
070                            { "groupId", Types.BIGINT },
071                            { "companyId", Types.BIGINT },
072                            { "userId", Types.BIGINT },
073                            { "userName", Types.VARCHAR },
074                            { "createDate", Types.TIMESTAMP },
075                            { "modifiedDate", Types.TIMESTAMP },
076                            { "classNameId", Types.BIGINT },
077                            { "classPK", Types.BIGINT },
078                            { "typePK", Types.BIGINT },
079                            { "workflowDefinitionName", Types.VARCHAR },
080                            { "workflowDefinitionVersion", Types.INTEGER }
081                    };
082            public static final String TABLE_SQL_CREATE = "create table WorkflowDefinitionLink (mvccVersion LONG default 0,workflowDefinitionLinkId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,classNameId LONG,classPK LONG,typePK LONG,workflowDefinitionName VARCHAR(75) null,workflowDefinitionVersion INTEGER)";
083            public static final String TABLE_SQL_DROP = "drop table WorkflowDefinitionLink";
084            public static final String ORDER_BY_JPQL = " ORDER BY workflowDefinitionLink.workflowDefinitionName ASC";
085            public static final String ORDER_BY_SQL = " ORDER BY WorkflowDefinitionLink.workflowDefinitionName ASC";
086            public static final String DATA_SOURCE = "liferayDataSource";
087            public static final String SESSION_FACTORY = "liferaySessionFactory";
088            public static final String TX_MANAGER = "liferayTransactionManager";
089            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
090                                    "value.object.entity.cache.enabled.com.liferay.portal.model.WorkflowDefinitionLink"),
091                            true);
092            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
093                                    "value.object.finder.cache.enabled.com.liferay.portal.model.WorkflowDefinitionLink"),
094                            true);
095            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
096                                    "value.object.column.bitmask.enabled.com.liferay.portal.model.WorkflowDefinitionLink"),
097                            true);
098            public static final long CLASSNAMEID_COLUMN_BITMASK = 1L;
099            public static final long CLASSPK_COLUMN_BITMASK = 2L;
100            public static final long COMPANYID_COLUMN_BITMASK = 4L;
101            public static final long GROUPID_COLUMN_BITMASK = 8L;
102            public static final long TYPEPK_COLUMN_BITMASK = 16L;
103            public static final long WORKFLOWDEFINITIONNAME_COLUMN_BITMASK = 32L;
104            public static final long WORKFLOWDEFINITIONVERSION_COLUMN_BITMASK = 64L;
105            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
106                                    "lock.expiration.time.com.liferay.portal.model.WorkflowDefinitionLink"));
107    
108            public WorkflowDefinitionLinkModelImpl() {
109            }
110    
111            @Override
112            public long getPrimaryKey() {
113                    return _workflowDefinitionLinkId;
114            }
115    
116            @Override
117            public void setPrimaryKey(long primaryKey) {
118                    setWorkflowDefinitionLinkId(primaryKey);
119            }
120    
121            @Override
122            public Serializable getPrimaryKeyObj() {
123                    return _workflowDefinitionLinkId;
124            }
125    
126            @Override
127            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
128                    setPrimaryKey(((Long)primaryKeyObj).longValue());
129            }
130    
131            @Override
132            public Class<?> getModelClass() {
133                    return WorkflowDefinitionLink.class;
134            }
135    
136            @Override
137            public String getModelClassName() {
138                    return WorkflowDefinitionLink.class.getName();
139            }
140    
141            @Override
142            public Map<String, Object> getModelAttributes() {
143                    Map<String, Object> attributes = new HashMap<String, Object>();
144    
145                    attributes.put("mvccVersion", getMvccVersion());
146                    attributes.put("workflowDefinitionLinkId", getWorkflowDefinitionLinkId());
147                    attributes.put("groupId", getGroupId());
148                    attributes.put("companyId", getCompanyId());
149                    attributes.put("userId", getUserId());
150                    attributes.put("userName", getUserName());
151                    attributes.put("createDate", getCreateDate());
152                    attributes.put("modifiedDate", getModifiedDate());
153                    attributes.put("classNameId", getClassNameId());
154                    attributes.put("classPK", getClassPK());
155                    attributes.put("typePK", getTypePK());
156                    attributes.put("workflowDefinitionName", getWorkflowDefinitionName());
157                    attributes.put("workflowDefinitionVersion",
158                            getWorkflowDefinitionVersion());
159    
160                    attributes.put("entityCacheEnabled", isEntityCacheEnabled());
161                    attributes.put("finderCacheEnabled", isFinderCacheEnabled());
162    
163                    return attributes;
164            }
165    
166            @Override
167            public void setModelAttributes(Map<String, Object> attributes) {
168                    Long mvccVersion = (Long)attributes.get("mvccVersion");
169    
170                    if (mvccVersion != null) {
171                            setMvccVersion(mvccVersion);
172                    }
173    
174                    Long workflowDefinitionLinkId = (Long)attributes.get(
175                                    "workflowDefinitionLinkId");
176    
177                    if (workflowDefinitionLinkId != null) {
178                            setWorkflowDefinitionLinkId(workflowDefinitionLinkId);
179                    }
180    
181                    Long groupId = (Long)attributes.get("groupId");
182    
183                    if (groupId != null) {
184                            setGroupId(groupId);
185                    }
186    
187                    Long companyId = (Long)attributes.get("companyId");
188    
189                    if (companyId != null) {
190                            setCompanyId(companyId);
191                    }
192    
193                    Long userId = (Long)attributes.get("userId");
194    
195                    if (userId != null) {
196                            setUserId(userId);
197                    }
198    
199                    String userName = (String)attributes.get("userName");
200    
201                    if (userName != null) {
202                            setUserName(userName);
203                    }
204    
205                    Date createDate = (Date)attributes.get("createDate");
206    
207                    if (createDate != null) {
208                            setCreateDate(createDate);
209                    }
210    
211                    Date modifiedDate = (Date)attributes.get("modifiedDate");
212    
213                    if (modifiedDate != null) {
214                            setModifiedDate(modifiedDate);
215                    }
216    
217                    Long classNameId = (Long)attributes.get("classNameId");
218    
219                    if (classNameId != null) {
220                            setClassNameId(classNameId);
221                    }
222    
223                    Long classPK = (Long)attributes.get("classPK");
224    
225                    if (classPK != null) {
226                            setClassPK(classPK);
227                    }
228    
229                    Long typePK = (Long)attributes.get("typePK");
230    
231                    if (typePK != null) {
232                            setTypePK(typePK);
233                    }
234    
235                    String workflowDefinitionName = (String)attributes.get(
236                                    "workflowDefinitionName");
237    
238                    if (workflowDefinitionName != null) {
239                            setWorkflowDefinitionName(workflowDefinitionName);
240                    }
241    
242                    Integer workflowDefinitionVersion = (Integer)attributes.get(
243                                    "workflowDefinitionVersion");
244    
245                    if (workflowDefinitionVersion != null) {
246                            setWorkflowDefinitionVersion(workflowDefinitionVersion);
247                    }
248            }
249    
250            @Override
251            public long getMvccVersion() {
252                    return _mvccVersion;
253            }
254    
255            @Override
256            public void setMvccVersion(long mvccVersion) {
257                    _mvccVersion = mvccVersion;
258            }
259    
260            @Override
261            public long getWorkflowDefinitionLinkId() {
262                    return _workflowDefinitionLinkId;
263            }
264    
265            @Override
266            public void setWorkflowDefinitionLinkId(long workflowDefinitionLinkId) {
267                    _workflowDefinitionLinkId = workflowDefinitionLinkId;
268            }
269    
270            @Override
271            public long getGroupId() {
272                    return _groupId;
273            }
274    
275            @Override
276            public void setGroupId(long groupId) {
277                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
278    
279                    if (!_setOriginalGroupId) {
280                            _setOriginalGroupId = true;
281    
282                            _originalGroupId = _groupId;
283                    }
284    
285                    _groupId = groupId;
286            }
287    
288            public long getOriginalGroupId() {
289                    return _originalGroupId;
290            }
291    
292            @Override
293            public long getCompanyId() {
294                    return _companyId;
295            }
296    
297            @Override
298            public void setCompanyId(long companyId) {
299                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
300    
301                    if (!_setOriginalCompanyId) {
302                            _setOriginalCompanyId = true;
303    
304                            _originalCompanyId = _companyId;
305                    }
306    
307                    _companyId = companyId;
308            }
309    
310            public long getOriginalCompanyId() {
311                    return _originalCompanyId;
312            }
313    
314            @Override
315            public long getUserId() {
316                    return _userId;
317            }
318    
319            @Override
320            public void setUserId(long userId) {
321                    _userId = userId;
322            }
323    
324            @Override
325            public String getUserUuid() {
326                    try {
327                            User user = UserLocalServiceUtil.getUserById(getUserId());
328    
329                            return user.getUuid();
330                    }
331                    catch (PortalException pe) {
332                            return StringPool.BLANK;
333                    }
334            }
335    
336            @Override
337            public void setUserUuid(String userUuid) {
338            }
339    
340            @Override
341            public String getUserName() {
342                    if (_userName == null) {
343                            return StringPool.BLANK;
344                    }
345                    else {
346                            return _userName;
347                    }
348            }
349    
350            @Override
351            public void setUserName(String userName) {
352                    _userName = userName;
353            }
354    
355            @Override
356            public Date getCreateDate() {
357                    return _createDate;
358            }
359    
360            @Override
361            public void setCreateDate(Date createDate) {
362                    _createDate = createDate;
363            }
364    
365            @Override
366            public Date getModifiedDate() {
367                    return _modifiedDate;
368            }
369    
370            public boolean hasSetModifiedDate() {
371                    return _setModifiedDate;
372            }
373    
374            @Override
375            public void setModifiedDate(Date modifiedDate) {
376                    _setModifiedDate = true;
377    
378                    _modifiedDate = modifiedDate;
379            }
380    
381            @Override
382            public String getClassName() {
383                    if (getClassNameId() <= 0) {
384                            return StringPool.BLANK;
385                    }
386    
387                    return PortalUtil.getClassName(getClassNameId());
388            }
389    
390            @Override
391            public void setClassName(String className) {
392                    long classNameId = 0;
393    
394                    if (Validator.isNotNull(className)) {
395                            classNameId = PortalUtil.getClassNameId(className);
396                    }
397    
398                    setClassNameId(classNameId);
399            }
400    
401            @Override
402            public long getClassNameId() {
403                    return _classNameId;
404            }
405    
406            @Override
407            public void setClassNameId(long classNameId) {
408                    _columnBitmask |= CLASSNAMEID_COLUMN_BITMASK;
409    
410                    if (!_setOriginalClassNameId) {
411                            _setOriginalClassNameId = true;
412    
413                            _originalClassNameId = _classNameId;
414                    }
415    
416                    _classNameId = classNameId;
417            }
418    
419            public long getOriginalClassNameId() {
420                    return _originalClassNameId;
421            }
422    
423            @Override
424            public long getClassPK() {
425                    return _classPK;
426            }
427    
428            @Override
429            public void setClassPK(long classPK) {
430                    _columnBitmask |= CLASSPK_COLUMN_BITMASK;
431    
432                    if (!_setOriginalClassPK) {
433                            _setOriginalClassPK = true;
434    
435                            _originalClassPK = _classPK;
436                    }
437    
438                    _classPK = classPK;
439            }
440    
441            public long getOriginalClassPK() {
442                    return _originalClassPK;
443            }
444    
445            @Override
446            public long getTypePK() {
447                    return _typePK;
448            }
449    
450            @Override
451            public void setTypePK(long typePK) {
452                    _columnBitmask |= TYPEPK_COLUMN_BITMASK;
453    
454                    if (!_setOriginalTypePK) {
455                            _setOriginalTypePK = true;
456    
457                            _originalTypePK = _typePK;
458                    }
459    
460                    _typePK = typePK;
461            }
462    
463            public long getOriginalTypePK() {
464                    return _originalTypePK;
465            }
466    
467            @Override
468            public String getWorkflowDefinitionName() {
469                    if (_workflowDefinitionName == null) {
470                            return StringPool.BLANK;
471                    }
472                    else {
473                            return _workflowDefinitionName;
474                    }
475            }
476    
477            @Override
478            public void setWorkflowDefinitionName(String workflowDefinitionName) {
479                    _columnBitmask = -1L;
480    
481                    if (_originalWorkflowDefinitionName == null) {
482                            _originalWorkflowDefinitionName = _workflowDefinitionName;
483                    }
484    
485                    _workflowDefinitionName = workflowDefinitionName;
486            }
487    
488            public String getOriginalWorkflowDefinitionName() {
489                    return GetterUtil.getString(_originalWorkflowDefinitionName);
490            }
491    
492            @Override
493            public int getWorkflowDefinitionVersion() {
494                    return _workflowDefinitionVersion;
495            }
496    
497            @Override
498            public void setWorkflowDefinitionVersion(int workflowDefinitionVersion) {
499                    _columnBitmask |= WORKFLOWDEFINITIONVERSION_COLUMN_BITMASK;
500    
501                    if (!_setOriginalWorkflowDefinitionVersion) {
502                            _setOriginalWorkflowDefinitionVersion = true;
503    
504                            _originalWorkflowDefinitionVersion = _workflowDefinitionVersion;
505                    }
506    
507                    _workflowDefinitionVersion = workflowDefinitionVersion;
508            }
509    
510            public int getOriginalWorkflowDefinitionVersion() {
511                    return _originalWorkflowDefinitionVersion;
512            }
513    
514            public long getColumnBitmask() {
515                    return _columnBitmask;
516            }
517    
518            @Override
519            public ExpandoBridge getExpandoBridge() {
520                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
521                            WorkflowDefinitionLink.class.getName(), getPrimaryKey());
522            }
523    
524            @Override
525            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
526                    ExpandoBridge expandoBridge = getExpandoBridge();
527    
528                    expandoBridge.setAttributes(serviceContext);
529            }
530    
531            @Override
532            public WorkflowDefinitionLink toEscapedModel() {
533                    if (_escapedModel == null) {
534                            _escapedModel = (WorkflowDefinitionLink)ProxyUtil.newProxyInstance(_classLoader,
535                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
536                    }
537    
538                    return _escapedModel;
539            }
540    
541            @Override
542            public Object clone() {
543                    WorkflowDefinitionLinkImpl workflowDefinitionLinkImpl = new WorkflowDefinitionLinkImpl();
544    
545                    workflowDefinitionLinkImpl.setMvccVersion(getMvccVersion());
546                    workflowDefinitionLinkImpl.setWorkflowDefinitionLinkId(getWorkflowDefinitionLinkId());
547                    workflowDefinitionLinkImpl.setGroupId(getGroupId());
548                    workflowDefinitionLinkImpl.setCompanyId(getCompanyId());
549                    workflowDefinitionLinkImpl.setUserId(getUserId());
550                    workflowDefinitionLinkImpl.setUserName(getUserName());
551                    workflowDefinitionLinkImpl.setCreateDate(getCreateDate());
552                    workflowDefinitionLinkImpl.setModifiedDate(getModifiedDate());
553                    workflowDefinitionLinkImpl.setClassNameId(getClassNameId());
554                    workflowDefinitionLinkImpl.setClassPK(getClassPK());
555                    workflowDefinitionLinkImpl.setTypePK(getTypePK());
556                    workflowDefinitionLinkImpl.setWorkflowDefinitionName(getWorkflowDefinitionName());
557                    workflowDefinitionLinkImpl.setWorkflowDefinitionVersion(getWorkflowDefinitionVersion());
558    
559                    workflowDefinitionLinkImpl.resetOriginalValues();
560    
561                    return workflowDefinitionLinkImpl;
562            }
563    
564            @Override
565            public int compareTo(WorkflowDefinitionLink workflowDefinitionLink) {
566                    int value = 0;
567    
568                    value = getWorkflowDefinitionName()
569                                            .compareTo(workflowDefinitionLink.getWorkflowDefinitionName());
570    
571                    if (value != 0) {
572                            return value;
573                    }
574    
575                    return 0;
576            }
577    
578            @Override
579            public boolean equals(Object obj) {
580                    if (this == obj) {
581                            return true;
582                    }
583    
584                    if (!(obj instanceof WorkflowDefinitionLink)) {
585                            return false;
586                    }
587    
588                    WorkflowDefinitionLink workflowDefinitionLink = (WorkflowDefinitionLink)obj;
589    
590                    long primaryKey = workflowDefinitionLink.getPrimaryKey();
591    
592                    if (getPrimaryKey() == primaryKey) {
593                            return true;
594                    }
595                    else {
596                            return false;
597                    }
598            }
599    
600            @Override
601            public int hashCode() {
602                    return (int)getPrimaryKey();
603            }
604    
605            @Override
606            public boolean isEntityCacheEnabled() {
607                    return ENTITY_CACHE_ENABLED;
608            }
609    
610            @Override
611            public boolean isFinderCacheEnabled() {
612                    return FINDER_CACHE_ENABLED;
613            }
614    
615            @Override
616            public void resetOriginalValues() {
617                    WorkflowDefinitionLinkModelImpl workflowDefinitionLinkModelImpl = this;
618    
619                    workflowDefinitionLinkModelImpl._originalGroupId = workflowDefinitionLinkModelImpl._groupId;
620    
621                    workflowDefinitionLinkModelImpl._setOriginalGroupId = false;
622    
623                    workflowDefinitionLinkModelImpl._originalCompanyId = workflowDefinitionLinkModelImpl._companyId;
624    
625                    workflowDefinitionLinkModelImpl._setOriginalCompanyId = false;
626    
627                    workflowDefinitionLinkModelImpl._setModifiedDate = false;
628    
629                    workflowDefinitionLinkModelImpl._originalClassNameId = workflowDefinitionLinkModelImpl._classNameId;
630    
631                    workflowDefinitionLinkModelImpl._setOriginalClassNameId = false;
632    
633                    workflowDefinitionLinkModelImpl._originalClassPK = workflowDefinitionLinkModelImpl._classPK;
634    
635                    workflowDefinitionLinkModelImpl._setOriginalClassPK = false;
636    
637                    workflowDefinitionLinkModelImpl._originalTypePK = workflowDefinitionLinkModelImpl._typePK;
638    
639                    workflowDefinitionLinkModelImpl._setOriginalTypePK = false;
640    
641                    workflowDefinitionLinkModelImpl._originalWorkflowDefinitionName = workflowDefinitionLinkModelImpl._workflowDefinitionName;
642    
643                    workflowDefinitionLinkModelImpl._originalWorkflowDefinitionVersion = workflowDefinitionLinkModelImpl._workflowDefinitionVersion;
644    
645                    workflowDefinitionLinkModelImpl._setOriginalWorkflowDefinitionVersion = false;
646    
647                    workflowDefinitionLinkModelImpl._columnBitmask = 0;
648            }
649    
650            @Override
651            public CacheModel<WorkflowDefinitionLink> toCacheModel() {
652                    WorkflowDefinitionLinkCacheModel workflowDefinitionLinkCacheModel = new WorkflowDefinitionLinkCacheModel();
653    
654                    workflowDefinitionLinkCacheModel.mvccVersion = getMvccVersion();
655    
656                    workflowDefinitionLinkCacheModel.workflowDefinitionLinkId = getWorkflowDefinitionLinkId();
657    
658                    workflowDefinitionLinkCacheModel.groupId = getGroupId();
659    
660                    workflowDefinitionLinkCacheModel.companyId = getCompanyId();
661    
662                    workflowDefinitionLinkCacheModel.userId = getUserId();
663    
664                    workflowDefinitionLinkCacheModel.userName = getUserName();
665    
666                    String userName = workflowDefinitionLinkCacheModel.userName;
667    
668                    if ((userName != null) && (userName.length() == 0)) {
669                            workflowDefinitionLinkCacheModel.userName = null;
670                    }
671    
672                    Date createDate = getCreateDate();
673    
674                    if (createDate != null) {
675                            workflowDefinitionLinkCacheModel.createDate = createDate.getTime();
676                    }
677                    else {
678                            workflowDefinitionLinkCacheModel.createDate = Long.MIN_VALUE;
679                    }
680    
681                    Date modifiedDate = getModifiedDate();
682    
683                    if (modifiedDate != null) {
684                            workflowDefinitionLinkCacheModel.modifiedDate = modifiedDate.getTime();
685                    }
686                    else {
687                            workflowDefinitionLinkCacheModel.modifiedDate = Long.MIN_VALUE;
688                    }
689    
690                    workflowDefinitionLinkCacheModel.classNameId = getClassNameId();
691    
692                    workflowDefinitionLinkCacheModel.classPK = getClassPK();
693    
694                    workflowDefinitionLinkCacheModel.typePK = getTypePK();
695    
696                    workflowDefinitionLinkCacheModel.workflowDefinitionName = getWorkflowDefinitionName();
697    
698                    String workflowDefinitionName = workflowDefinitionLinkCacheModel.workflowDefinitionName;
699    
700                    if ((workflowDefinitionName != null) &&
701                                    (workflowDefinitionName.length() == 0)) {
702                            workflowDefinitionLinkCacheModel.workflowDefinitionName = null;
703                    }
704    
705                    workflowDefinitionLinkCacheModel.workflowDefinitionVersion = getWorkflowDefinitionVersion();
706    
707                    return workflowDefinitionLinkCacheModel;
708            }
709    
710            @Override
711            public String toString() {
712                    StringBundler sb = new StringBundler(27);
713    
714                    sb.append("{mvccVersion=");
715                    sb.append(getMvccVersion());
716                    sb.append(", workflowDefinitionLinkId=");
717                    sb.append(getWorkflowDefinitionLinkId());
718                    sb.append(", groupId=");
719                    sb.append(getGroupId());
720                    sb.append(", companyId=");
721                    sb.append(getCompanyId());
722                    sb.append(", userId=");
723                    sb.append(getUserId());
724                    sb.append(", userName=");
725                    sb.append(getUserName());
726                    sb.append(", createDate=");
727                    sb.append(getCreateDate());
728                    sb.append(", modifiedDate=");
729                    sb.append(getModifiedDate());
730                    sb.append(", classNameId=");
731                    sb.append(getClassNameId());
732                    sb.append(", classPK=");
733                    sb.append(getClassPK());
734                    sb.append(", typePK=");
735                    sb.append(getTypePK());
736                    sb.append(", workflowDefinitionName=");
737                    sb.append(getWorkflowDefinitionName());
738                    sb.append(", workflowDefinitionVersion=");
739                    sb.append(getWorkflowDefinitionVersion());
740                    sb.append("}");
741    
742                    return sb.toString();
743            }
744    
745            @Override
746            public String toXmlString() {
747                    StringBundler sb = new StringBundler(43);
748    
749                    sb.append("<model><model-name>");
750                    sb.append("com.liferay.portal.model.WorkflowDefinitionLink");
751                    sb.append("</model-name>");
752    
753                    sb.append(
754                            "<column><column-name>mvccVersion</column-name><column-value><![CDATA[");
755                    sb.append(getMvccVersion());
756                    sb.append("]]></column-value></column>");
757                    sb.append(
758                            "<column><column-name>workflowDefinitionLinkId</column-name><column-value><![CDATA[");
759                    sb.append(getWorkflowDefinitionLinkId());
760                    sb.append("]]></column-value></column>");
761                    sb.append(
762                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
763                    sb.append(getGroupId());
764                    sb.append("]]></column-value></column>");
765                    sb.append(
766                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
767                    sb.append(getCompanyId());
768                    sb.append("]]></column-value></column>");
769                    sb.append(
770                            "<column><column-name>userId</column-name><column-value><![CDATA[");
771                    sb.append(getUserId());
772                    sb.append("]]></column-value></column>");
773                    sb.append(
774                            "<column><column-name>userName</column-name><column-value><![CDATA[");
775                    sb.append(getUserName());
776                    sb.append("]]></column-value></column>");
777                    sb.append(
778                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
779                    sb.append(getCreateDate());
780                    sb.append("]]></column-value></column>");
781                    sb.append(
782                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
783                    sb.append(getModifiedDate());
784                    sb.append("]]></column-value></column>");
785                    sb.append(
786                            "<column><column-name>classNameId</column-name><column-value><![CDATA[");
787                    sb.append(getClassNameId());
788                    sb.append("]]></column-value></column>");
789                    sb.append(
790                            "<column><column-name>classPK</column-name><column-value><![CDATA[");
791                    sb.append(getClassPK());
792                    sb.append("]]></column-value></column>");
793                    sb.append(
794                            "<column><column-name>typePK</column-name><column-value><![CDATA[");
795                    sb.append(getTypePK());
796                    sb.append("]]></column-value></column>");
797                    sb.append(
798                            "<column><column-name>workflowDefinitionName</column-name><column-value><![CDATA[");
799                    sb.append(getWorkflowDefinitionName());
800                    sb.append("]]></column-value></column>");
801                    sb.append(
802                            "<column><column-name>workflowDefinitionVersion</column-name><column-value><![CDATA[");
803                    sb.append(getWorkflowDefinitionVersion());
804                    sb.append("]]></column-value></column>");
805    
806                    sb.append("</model>");
807    
808                    return sb.toString();
809            }
810    
811            private static final ClassLoader _classLoader = WorkflowDefinitionLink.class.getClassLoader();
812            private static final Class<?>[] _escapedModelInterfaces = new Class[] {
813                            WorkflowDefinitionLink.class
814                    };
815            private long _mvccVersion;
816            private long _workflowDefinitionLinkId;
817            private long _groupId;
818            private long _originalGroupId;
819            private boolean _setOriginalGroupId;
820            private long _companyId;
821            private long _originalCompanyId;
822            private boolean _setOriginalCompanyId;
823            private long _userId;
824            private String _userName;
825            private Date _createDate;
826            private Date _modifiedDate;
827            private boolean _setModifiedDate;
828            private long _classNameId;
829            private long _originalClassNameId;
830            private boolean _setOriginalClassNameId;
831            private long _classPK;
832            private long _originalClassPK;
833            private boolean _setOriginalClassPK;
834            private long _typePK;
835            private long _originalTypePK;
836            private boolean _setOriginalTypePK;
837            private String _workflowDefinitionName;
838            private String _originalWorkflowDefinitionName;
839            private int _workflowDefinitionVersion;
840            private int _originalWorkflowDefinitionVersion;
841            private boolean _setOriginalWorkflowDefinitionVersion;
842            private long _columnBitmask;
843            private WorkflowDefinitionLink _escapedModel;
844    }