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 com.liferay.portlet.softwarecatalog.model.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 com.liferay.portlet.softwarecatalog.model.SCProductEntry
059     * @see com.liferay.portlet.softwarecatalog.model.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 com.liferay.portlet.softwarecatalog.model.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            @Override
471            public void setModifiedDate(Date modifiedDate) {
472                    _columnBitmask = -1L;
473    
474                    _modifiedDate = modifiedDate;
475            }
476    
477            @JSON
478            @Override
479            public String getName() {
480                    if (_name == null) {
481                            return StringPool.BLANK;
482                    }
483                    else {
484                            return _name;
485                    }
486            }
487    
488            @Override
489            public void setName(String name) {
490                    _columnBitmask = -1L;
491    
492                    _name = name;
493            }
494    
495            @JSON
496            @Override
497            public String getType() {
498                    if (_type == null) {
499                            return StringPool.BLANK;
500                    }
501                    else {
502                            return _type;
503                    }
504            }
505    
506            @Override
507            public void setType(String type) {
508                    _type = type;
509            }
510    
511            @JSON
512            @Override
513            public String getTags() {
514                    if (_tags == null) {
515                            return StringPool.BLANK;
516                    }
517                    else {
518                            return _tags;
519                    }
520            }
521    
522            @Override
523            public void setTags(String tags) {
524                    _tags = tags;
525            }
526    
527            @JSON
528            @Override
529            public String getShortDescription() {
530                    if (_shortDescription == null) {
531                            return StringPool.BLANK;
532                    }
533                    else {
534                            return _shortDescription;
535                    }
536            }
537    
538            @Override
539            public void setShortDescription(String shortDescription) {
540                    _shortDescription = shortDescription;
541            }
542    
543            @JSON
544            @Override
545            public String getLongDescription() {
546                    if (_longDescription == null) {
547                            return StringPool.BLANK;
548                    }
549                    else {
550                            return _longDescription;
551                    }
552            }
553    
554            @Override
555            public void setLongDescription(String longDescription) {
556                    _longDescription = longDescription;
557            }
558    
559            @JSON
560            @Override
561            public String getPageURL() {
562                    if (_pageURL == null) {
563                            return StringPool.BLANK;
564                    }
565                    else {
566                            return _pageURL;
567                    }
568            }
569    
570            @Override
571            public void setPageURL(String pageURL) {
572                    _pageURL = pageURL;
573            }
574    
575            @JSON
576            @Override
577            public String getAuthor() {
578                    if (_author == null) {
579                            return StringPool.BLANK;
580                    }
581                    else {
582                            return _author;
583                    }
584            }
585    
586            @Override
587            public void setAuthor(String author) {
588                    _author = author;
589            }
590    
591            @JSON
592            @Override
593            public String getRepoGroupId() {
594                    if (_repoGroupId == null) {
595                            return StringPool.BLANK;
596                    }
597                    else {
598                            return _repoGroupId;
599                    }
600            }
601    
602            @Override
603            public void setRepoGroupId(String repoGroupId) {
604                    _columnBitmask |= REPOGROUPID_COLUMN_BITMASK;
605    
606                    if (_originalRepoGroupId == null) {
607                            _originalRepoGroupId = _repoGroupId;
608                    }
609    
610                    _repoGroupId = repoGroupId;
611            }
612    
613            public String getOriginalRepoGroupId() {
614                    return GetterUtil.getString(_originalRepoGroupId);
615            }
616    
617            @JSON
618            @Override
619            public String getRepoArtifactId() {
620                    if (_repoArtifactId == null) {
621                            return StringPool.BLANK;
622                    }
623                    else {
624                            return _repoArtifactId;
625                    }
626            }
627    
628            @Override
629            public void setRepoArtifactId(String repoArtifactId) {
630                    _columnBitmask |= REPOARTIFACTID_COLUMN_BITMASK;
631    
632                    if (_originalRepoArtifactId == null) {
633                            _originalRepoArtifactId = _repoArtifactId;
634                    }
635    
636                    _repoArtifactId = repoArtifactId;
637            }
638    
639            public String getOriginalRepoArtifactId() {
640                    return GetterUtil.getString(_originalRepoArtifactId);
641            }
642    
643            public long getColumnBitmask() {
644                    return _columnBitmask;
645            }
646    
647            @Override
648            public ExpandoBridge getExpandoBridge() {
649                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
650                            SCProductEntry.class.getName(), getPrimaryKey());
651            }
652    
653            @Override
654            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
655                    ExpandoBridge expandoBridge = getExpandoBridge();
656    
657                    expandoBridge.setAttributes(serviceContext);
658            }
659    
660            @Override
661            public SCProductEntry toEscapedModel() {
662                    if (_escapedModel == null) {
663                            _escapedModel = (SCProductEntry)ProxyUtil.newProxyInstance(_classLoader,
664                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
665                    }
666    
667                    return _escapedModel;
668            }
669    
670            @Override
671            public Object clone() {
672                    SCProductEntryImpl scProductEntryImpl = new SCProductEntryImpl();
673    
674                    scProductEntryImpl.setProductEntryId(getProductEntryId());
675                    scProductEntryImpl.setGroupId(getGroupId());
676                    scProductEntryImpl.setCompanyId(getCompanyId());
677                    scProductEntryImpl.setUserId(getUserId());
678                    scProductEntryImpl.setUserName(getUserName());
679                    scProductEntryImpl.setCreateDate(getCreateDate());
680                    scProductEntryImpl.setModifiedDate(getModifiedDate());
681                    scProductEntryImpl.setName(getName());
682                    scProductEntryImpl.setType(getType());
683                    scProductEntryImpl.setTags(getTags());
684                    scProductEntryImpl.setShortDescription(getShortDescription());
685                    scProductEntryImpl.setLongDescription(getLongDescription());
686                    scProductEntryImpl.setPageURL(getPageURL());
687                    scProductEntryImpl.setAuthor(getAuthor());
688                    scProductEntryImpl.setRepoGroupId(getRepoGroupId());
689                    scProductEntryImpl.setRepoArtifactId(getRepoArtifactId());
690    
691                    scProductEntryImpl.resetOriginalValues();
692    
693                    return scProductEntryImpl;
694            }
695    
696            @Override
697            public int compareTo(SCProductEntry scProductEntry) {
698                    int value = 0;
699    
700                    value = DateUtil.compareTo(getModifiedDate(),
701                                    scProductEntry.getModifiedDate());
702    
703                    value = value * -1;
704    
705                    if (value != 0) {
706                            return value;
707                    }
708    
709                    value = getName().compareTo(scProductEntry.getName());
710    
711                    value = value * -1;
712    
713                    if (value != 0) {
714                            return value;
715                    }
716    
717                    return 0;
718            }
719    
720            @Override
721            public boolean equals(Object obj) {
722                    if (this == obj) {
723                            return true;
724                    }
725    
726                    if (!(obj instanceof SCProductEntry)) {
727                            return false;
728                    }
729    
730                    SCProductEntry scProductEntry = (SCProductEntry)obj;
731    
732                    long primaryKey = scProductEntry.getPrimaryKey();
733    
734                    if (getPrimaryKey() == primaryKey) {
735                            return true;
736                    }
737                    else {
738                            return false;
739                    }
740            }
741    
742            @Override
743            public int hashCode() {
744                    return (int)getPrimaryKey();
745            }
746    
747            @Override
748            public boolean isEntityCacheEnabled() {
749                    return ENTITY_CACHE_ENABLED;
750            }
751    
752            @Override
753            public boolean isFinderCacheEnabled() {
754                    return FINDER_CACHE_ENABLED;
755            }
756    
757            @Override
758            public void resetOriginalValues() {
759                    SCProductEntryModelImpl scProductEntryModelImpl = this;
760    
761                    scProductEntryModelImpl._originalGroupId = scProductEntryModelImpl._groupId;
762    
763                    scProductEntryModelImpl._setOriginalGroupId = false;
764    
765                    scProductEntryModelImpl._originalCompanyId = scProductEntryModelImpl._companyId;
766    
767                    scProductEntryModelImpl._setOriginalCompanyId = false;
768    
769                    scProductEntryModelImpl._originalUserId = scProductEntryModelImpl._userId;
770    
771                    scProductEntryModelImpl._setOriginalUserId = false;
772    
773                    scProductEntryModelImpl._originalRepoGroupId = scProductEntryModelImpl._repoGroupId;
774    
775                    scProductEntryModelImpl._originalRepoArtifactId = scProductEntryModelImpl._repoArtifactId;
776    
777                    scProductEntryModelImpl._columnBitmask = 0;
778            }
779    
780            @Override
781            public CacheModel<SCProductEntry> toCacheModel() {
782                    SCProductEntryCacheModel scProductEntryCacheModel = new SCProductEntryCacheModel();
783    
784                    scProductEntryCacheModel.productEntryId = getProductEntryId();
785    
786                    scProductEntryCacheModel.groupId = getGroupId();
787    
788                    scProductEntryCacheModel.companyId = getCompanyId();
789    
790                    scProductEntryCacheModel.userId = getUserId();
791    
792                    scProductEntryCacheModel.userName = getUserName();
793    
794                    String userName = scProductEntryCacheModel.userName;
795    
796                    if ((userName != null) && (userName.length() == 0)) {
797                            scProductEntryCacheModel.userName = null;
798                    }
799    
800                    Date createDate = getCreateDate();
801    
802                    if (createDate != null) {
803                            scProductEntryCacheModel.createDate = createDate.getTime();
804                    }
805                    else {
806                            scProductEntryCacheModel.createDate = Long.MIN_VALUE;
807                    }
808    
809                    Date modifiedDate = getModifiedDate();
810    
811                    if (modifiedDate != null) {
812                            scProductEntryCacheModel.modifiedDate = modifiedDate.getTime();
813                    }
814                    else {
815                            scProductEntryCacheModel.modifiedDate = Long.MIN_VALUE;
816                    }
817    
818                    scProductEntryCacheModel.name = getName();
819    
820                    String name = scProductEntryCacheModel.name;
821    
822                    if ((name != null) && (name.length() == 0)) {
823                            scProductEntryCacheModel.name = null;
824                    }
825    
826                    scProductEntryCacheModel.type = getType();
827    
828                    String type = scProductEntryCacheModel.type;
829    
830                    if ((type != null) && (type.length() == 0)) {
831                            scProductEntryCacheModel.type = null;
832                    }
833    
834                    scProductEntryCacheModel.tags = getTags();
835    
836                    String tags = scProductEntryCacheModel.tags;
837    
838                    if ((tags != null) && (tags.length() == 0)) {
839                            scProductEntryCacheModel.tags = null;
840                    }
841    
842                    scProductEntryCacheModel.shortDescription = getShortDescription();
843    
844                    String shortDescription = scProductEntryCacheModel.shortDescription;
845    
846                    if ((shortDescription != null) && (shortDescription.length() == 0)) {
847                            scProductEntryCacheModel.shortDescription = null;
848                    }
849    
850                    scProductEntryCacheModel.longDescription = getLongDescription();
851    
852                    String longDescription = scProductEntryCacheModel.longDescription;
853    
854                    if ((longDescription != null) && (longDescription.length() == 0)) {
855                            scProductEntryCacheModel.longDescription = null;
856                    }
857    
858                    scProductEntryCacheModel.pageURL = getPageURL();
859    
860                    String pageURL = scProductEntryCacheModel.pageURL;
861    
862                    if ((pageURL != null) && (pageURL.length() == 0)) {
863                            scProductEntryCacheModel.pageURL = null;
864                    }
865    
866                    scProductEntryCacheModel.author = getAuthor();
867    
868                    String author = scProductEntryCacheModel.author;
869    
870                    if ((author != null) && (author.length() == 0)) {
871                            scProductEntryCacheModel.author = null;
872                    }
873    
874                    scProductEntryCacheModel.repoGroupId = getRepoGroupId();
875    
876                    String repoGroupId = scProductEntryCacheModel.repoGroupId;
877    
878                    if ((repoGroupId != null) && (repoGroupId.length() == 0)) {
879                            scProductEntryCacheModel.repoGroupId = null;
880                    }
881    
882                    scProductEntryCacheModel.repoArtifactId = getRepoArtifactId();
883    
884                    String repoArtifactId = scProductEntryCacheModel.repoArtifactId;
885    
886                    if ((repoArtifactId != null) && (repoArtifactId.length() == 0)) {
887                            scProductEntryCacheModel.repoArtifactId = null;
888                    }
889    
890                    return scProductEntryCacheModel;
891            }
892    
893            @Override
894            public String toString() {
895                    StringBundler sb = new StringBundler(33);
896    
897                    sb.append("{productEntryId=");
898                    sb.append(getProductEntryId());
899                    sb.append(", groupId=");
900                    sb.append(getGroupId());
901                    sb.append(", companyId=");
902                    sb.append(getCompanyId());
903                    sb.append(", userId=");
904                    sb.append(getUserId());
905                    sb.append(", userName=");
906                    sb.append(getUserName());
907                    sb.append(", createDate=");
908                    sb.append(getCreateDate());
909                    sb.append(", modifiedDate=");
910                    sb.append(getModifiedDate());
911                    sb.append(", name=");
912                    sb.append(getName());
913                    sb.append(", type=");
914                    sb.append(getType());
915                    sb.append(", tags=");
916                    sb.append(getTags());
917                    sb.append(", shortDescription=");
918                    sb.append(getShortDescription());
919                    sb.append(", longDescription=");
920                    sb.append(getLongDescription());
921                    sb.append(", pageURL=");
922                    sb.append(getPageURL());
923                    sb.append(", author=");
924                    sb.append(getAuthor());
925                    sb.append(", repoGroupId=");
926                    sb.append(getRepoGroupId());
927                    sb.append(", repoArtifactId=");
928                    sb.append(getRepoArtifactId());
929                    sb.append("}");
930    
931                    return sb.toString();
932            }
933    
934            @Override
935            public String toXmlString() {
936                    StringBundler sb = new StringBundler(52);
937    
938                    sb.append("<model><model-name>");
939                    sb.append("com.liferay.portlet.softwarecatalog.model.SCProductEntry");
940                    sb.append("</model-name>");
941    
942                    sb.append(
943                            "<column><column-name>productEntryId</column-name><column-value><![CDATA[");
944                    sb.append(getProductEntryId());
945                    sb.append("]]></column-value></column>");
946                    sb.append(
947                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
948                    sb.append(getGroupId());
949                    sb.append("]]></column-value></column>");
950                    sb.append(
951                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
952                    sb.append(getCompanyId());
953                    sb.append("]]></column-value></column>");
954                    sb.append(
955                            "<column><column-name>userId</column-name><column-value><![CDATA[");
956                    sb.append(getUserId());
957                    sb.append("]]></column-value></column>");
958                    sb.append(
959                            "<column><column-name>userName</column-name><column-value><![CDATA[");
960                    sb.append(getUserName());
961                    sb.append("]]></column-value></column>");
962                    sb.append(
963                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
964                    sb.append(getCreateDate());
965                    sb.append("]]></column-value></column>");
966                    sb.append(
967                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
968                    sb.append(getModifiedDate());
969                    sb.append("]]></column-value></column>");
970                    sb.append(
971                            "<column><column-name>name</column-name><column-value><![CDATA[");
972                    sb.append(getName());
973                    sb.append("]]></column-value></column>");
974                    sb.append(
975                            "<column><column-name>type</column-name><column-value><![CDATA[");
976                    sb.append(getType());
977                    sb.append("]]></column-value></column>");
978                    sb.append(
979                            "<column><column-name>tags</column-name><column-value><![CDATA[");
980                    sb.append(getTags());
981                    sb.append("]]></column-value></column>");
982                    sb.append(
983                            "<column><column-name>shortDescription</column-name><column-value><![CDATA[");
984                    sb.append(getShortDescription());
985                    sb.append("]]></column-value></column>");
986                    sb.append(
987                            "<column><column-name>longDescription</column-name><column-value><![CDATA[");
988                    sb.append(getLongDescription());
989                    sb.append("]]></column-value></column>");
990                    sb.append(
991                            "<column><column-name>pageURL</column-name><column-value><![CDATA[");
992                    sb.append(getPageURL());
993                    sb.append("]]></column-value></column>");
994                    sb.append(
995                            "<column><column-name>author</column-name><column-value><![CDATA[");
996                    sb.append(getAuthor());
997                    sb.append("]]></column-value></column>");
998                    sb.append(
999                            "<column><column-name>repoGroupId</column-name><column-value><![CDATA[");
1000                    sb.append(getRepoGroupId());
1001                    sb.append("]]></column-value></column>");
1002                    sb.append(
1003                            "<column><column-name>repoArtifactId</column-name><column-value><![CDATA[");
1004                    sb.append(getRepoArtifactId());
1005                    sb.append("]]></column-value></column>");
1006    
1007                    sb.append("</model>");
1008    
1009                    return sb.toString();
1010            }
1011    
1012            private static final ClassLoader _classLoader = SCProductEntry.class.getClassLoader();
1013            private static final Class<?>[] _escapedModelInterfaces = new Class[] {
1014                            SCProductEntry.class
1015                    };
1016            private long _productEntryId;
1017            private long _groupId;
1018            private long _originalGroupId;
1019            private boolean _setOriginalGroupId;
1020            private long _companyId;
1021            private long _originalCompanyId;
1022            private boolean _setOriginalCompanyId;
1023            private long _userId;
1024            private long _originalUserId;
1025            private boolean _setOriginalUserId;
1026            private String _userName;
1027            private Date _createDate;
1028            private Date _modifiedDate;
1029            private String _name;
1030            private String _type;
1031            private String _tags;
1032            private String _shortDescription;
1033            private String _longDescription;
1034            private String _pageURL;
1035            private String _author;
1036            private String _repoGroupId;
1037            private String _originalRepoGroupId;
1038            private String _repoArtifactId;
1039            private String _originalRepoArtifactId;
1040            private long _columnBitmask;
1041            private SCProductEntry _escapedModel;
1042    }