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