001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.asset.model.impl;
016    
017    import com.liferay.portal.LocaleException;
018    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.json.JSON;
021    import com.liferay.portal.kernel.language.LanguageUtil;
022    import com.liferay.portal.kernel.util.GetterUtil;
023    import com.liferay.portal.kernel.util.LocaleUtil;
024    import com.liferay.portal.kernel.util.LocalizationUtil;
025    import com.liferay.portal.kernel.util.ProxyUtil;
026    import com.liferay.portal.kernel.util.StringBundler;
027    import com.liferay.portal.kernel.util.StringPool;
028    import com.liferay.portal.kernel.util.Validator;
029    import com.liferay.portal.model.CacheModel;
030    import com.liferay.portal.model.impl.BaseModelImpl;
031    import com.liferay.portal.service.ServiceContext;
032    import com.liferay.portal.util.PortalUtil;
033    
034    import com.liferay.portlet.asset.model.AssetVocabulary;
035    import com.liferay.portlet.asset.model.AssetVocabularyModel;
036    import com.liferay.portlet.asset.model.AssetVocabularySoap;
037    import com.liferay.portlet.expando.model.ExpandoBridge;
038    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
039    
040    import java.io.Serializable;
041    
042    import java.sql.Types;
043    
044    import java.util.ArrayList;
045    import java.util.Date;
046    import java.util.HashMap;
047    import java.util.List;
048    import java.util.Locale;
049    import java.util.Map;
050    
051    /**
052     * The base model implementation for the AssetVocabulary service. Represents a row in the "AssetVocabulary" database table, with each column mapped to a property of this class.
053     *
054     * <p>
055     * This implementation and its corresponding interface {@link com.liferay.portlet.asset.model.AssetVocabularyModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link AssetVocabularyImpl}.
056     * </p>
057     *
058     * @author Brian Wing Shun Chan
059     * @see AssetVocabularyImpl
060     * @see com.liferay.portlet.asset.model.AssetVocabulary
061     * @see com.liferay.portlet.asset.model.AssetVocabularyModel
062     * @generated
063     */
064    @JSON(strict = true)
065    public class AssetVocabularyModelImpl extends BaseModelImpl<AssetVocabulary>
066            implements AssetVocabularyModel {
067            /*
068             * NOTE FOR DEVELOPERS:
069             *
070             * Never modify or reference this class directly. All methods that expect a asset vocabulary model instance should use the {@link com.liferay.portlet.asset.model.AssetVocabulary} interface instead.
071             */
072            public static final String TABLE_NAME = "AssetVocabulary";
073            public static final Object[][] TABLE_COLUMNS = {
074                            { "uuid_", Types.VARCHAR },
075                            { "vocabularyId", Types.BIGINT },
076                            { "groupId", Types.BIGINT },
077                            { "companyId", Types.BIGINT },
078                            { "userId", Types.BIGINT },
079                            { "userName", Types.VARCHAR },
080                            { "createDate", Types.TIMESTAMP },
081                            { "modifiedDate", Types.TIMESTAMP },
082                            { "name", Types.VARCHAR },
083                            { "title", Types.VARCHAR },
084                            { "description", Types.VARCHAR },
085                            { "settings_", Types.VARCHAR }
086                    };
087            public static final String TABLE_SQL_CREATE = "create table AssetVocabulary (uuid_ VARCHAR(75) null,vocabularyId 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,title STRING null,description STRING null,settings_ STRING null)";
088            public static final String TABLE_SQL_DROP = "drop table AssetVocabulary";
089            public static final String ORDER_BY_JPQL = " ORDER BY assetVocabulary.name ASC";
090            public static final String ORDER_BY_SQL = " ORDER BY AssetVocabulary.name ASC";
091            public static final String DATA_SOURCE = "liferayDataSource";
092            public static final String SESSION_FACTORY = "liferaySessionFactory";
093            public static final String TX_MANAGER = "liferayTransactionManager";
094            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
095                                    "value.object.entity.cache.enabled.com.liferay.portlet.asset.model.AssetVocabulary"),
096                            true);
097            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
098                                    "value.object.finder.cache.enabled.com.liferay.portlet.asset.model.AssetVocabulary"),
099                            true);
100            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
101                                    "value.object.column.bitmask.enabled.com.liferay.portlet.asset.model.AssetVocabulary"),
102                            true);
103            public static long COMPANYID_COLUMN_BITMASK = 1L;
104            public static long GROUPID_COLUMN_BITMASK = 2L;
105            public static long NAME_COLUMN_BITMASK = 4L;
106            public static long UUID_COLUMN_BITMASK = 8L;
107    
108            /**
109             * Converts the soap model instance into a normal model instance.
110             *
111             * @param soapModel the soap model instance to convert
112             * @return the normal model instance
113             */
114            public static AssetVocabulary toModel(AssetVocabularySoap soapModel) {
115                    if (soapModel == null) {
116                            return null;
117                    }
118    
119                    AssetVocabulary model = new AssetVocabularyImpl();
120    
121                    model.setUuid(soapModel.getUuid());
122                    model.setVocabularyId(soapModel.getVocabularyId());
123                    model.setGroupId(soapModel.getGroupId());
124                    model.setCompanyId(soapModel.getCompanyId());
125                    model.setUserId(soapModel.getUserId());
126                    model.setUserName(soapModel.getUserName());
127                    model.setCreateDate(soapModel.getCreateDate());
128                    model.setModifiedDate(soapModel.getModifiedDate());
129                    model.setName(soapModel.getName());
130                    model.setTitle(soapModel.getTitle());
131                    model.setDescription(soapModel.getDescription());
132                    model.setSettings(soapModel.getSettings());
133    
134                    return model;
135            }
136    
137            /**
138             * Converts the soap model instances into normal model instances.
139             *
140             * @param soapModels the soap model instances to convert
141             * @return the normal model instances
142             */
143            public static List<AssetVocabulary> toModels(
144                    AssetVocabularySoap[] soapModels) {
145                    if (soapModels == null) {
146                            return null;
147                    }
148    
149                    List<AssetVocabulary> models = new ArrayList<AssetVocabulary>(soapModels.length);
150    
151                    for (AssetVocabularySoap soapModel : soapModels) {
152                            models.add(toModel(soapModel));
153                    }
154    
155                    return models;
156            }
157    
158            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
159                                    "lock.expiration.time.com.liferay.portlet.asset.model.AssetVocabulary"));
160    
161            public AssetVocabularyModelImpl() {
162            }
163    
164            public long getPrimaryKey() {
165                    return _vocabularyId;
166            }
167    
168            public void setPrimaryKey(long primaryKey) {
169                    setVocabularyId(primaryKey);
170            }
171    
172            public Serializable getPrimaryKeyObj() {
173                    return new Long(_vocabularyId);
174            }
175    
176            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
177                    setPrimaryKey(((Long)primaryKeyObj).longValue());
178            }
179    
180            public Class<?> getModelClass() {
181                    return AssetVocabulary.class;
182            }
183    
184            public String getModelClassName() {
185                    return AssetVocabulary.class.getName();
186            }
187    
188            @Override
189            public Map<String, Object> getModelAttributes() {
190                    Map<String, Object> attributes = new HashMap<String, Object>();
191    
192                    attributes.put("uuid", getUuid());
193                    attributes.put("vocabularyId", getVocabularyId());
194                    attributes.put("groupId", getGroupId());
195                    attributes.put("companyId", getCompanyId());
196                    attributes.put("userId", getUserId());
197                    attributes.put("userName", getUserName());
198                    attributes.put("createDate", getCreateDate());
199                    attributes.put("modifiedDate", getModifiedDate());
200                    attributes.put("name", getName());
201                    attributes.put("title", getTitle());
202                    attributes.put("description", getDescription());
203                    attributes.put("settings", getSettings());
204    
205                    return attributes;
206            }
207    
208            @Override
209            public void setModelAttributes(Map<String, Object> attributes) {
210                    String uuid = (String)attributes.get("uuid");
211    
212                    if (uuid != null) {
213                            setUuid(uuid);
214                    }
215    
216                    Long vocabularyId = (Long)attributes.get("vocabularyId");
217    
218                    if (vocabularyId != null) {
219                            setVocabularyId(vocabularyId);
220                    }
221    
222                    Long groupId = (Long)attributes.get("groupId");
223    
224                    if (groupId != null) {
225                            setGroupId(groupId);
226                    }
227    
228                    Long companyId = (Long)attributes.get("companyId");
229    
230                    if (companyId != null) {
231                            setCompanyId(companyId);
232                    }
233    
234                    Long userId = (Long)attributes.get("userId");
235    
236                    if (userId != null) {
237                            setUserId(userId);
238                    }
239    
240                    String userName = (String)attributes.get("userName");
241    
242                    if (userName != null) {
243                            setUserName(userName);
244                    }
245    
246                    Date createDate = (Date)attributes.get("createDate");
247    
248                    if (createDate != null) {
249                            setCreateDate(createDate);
250                    }
251    
252                    Date modifiedDate = (Date)attributes.get("modifiedDate");
253    
254                    if (modifiedDate != null) {
255                            setModifiedDate(modifiedDate);
256                    }
257    
258                    String name = (String)attributes.get("name");
259    
260                    if (name != null) {
261                            setName(name);
262                    }
263    
264                    String title = (String)attributes.get("title");
265    
266                    if (title != null) {
267                            setTitle(title);
268                    }
269    
270                    String description = (String)attributes.get("description");
271    
272                    if (description != null) {
273                            setDescription(description);
274                    }
275    
276                    String settings = (String)attributes.get("settings");
277    
278                    if (settings != null) {
279                            setSettings(settings);
280                    }
281            }
282    
283            @JSON
284            public String getUuid() {
285                    if (_uuid == null) {
286                            return StringPool.BLANK;
287                    }
288                    else {
289                            return _uuid;
290                    }
291            }
292    
293            public void setUuid(String uuid) {
294                    if (_originalUuid == null) {
295                            _originalUuid = _uuid;
296                    }
297    
298                    _uuid = uuid;
299            }
300    
301            public String getOriginalUuid() {
302                    return GetterUtil.getString(_originalUuid);
303            }
304    
305            @JSON
306            public long getVocabularyId() {
307                    return _vocabularyId;
308            }
309    
310            public void setVocabularyId(long vocabularyId) {
311                    _vocabularyId = vocabularyId;
312            }
313    
314            @JSON
315            public long getGroupId() {
316                    return _groupId;
317            }
318    
319            public void setGroupId(long groupId) {
320                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
321    
322                    if (!_setOriginalGroupId) {
323                            _setOriginalGroupId = true;
324    
325                            _originalGroupId = _groupId;
326                    }
327    
328                    _groupId = groupId;
329            }
330    
331            public long getOriginalGroupId() {
332                    return _originalGroupId;
333            }
334    
335            @JSON
336            public long getCompanyId() {
337                    return _companyId;
338            }
339    
340            public void setCompanyId(long companyId) {
341                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
342    
343                    if (!_setOriginalCompanyId) {
344                            _setOriginalCompanyId = true;
345    
346                            _originalCompanyId = _companyId;
347                    }
348    
349                    _companyId = companyId;
350            }
351    
352            public long getOriginalCompanyId() {
353                    return _originalCompanyId;
354            }
355    
356            @JSON
357            public long getUserId() {
358                    return _userId;
359            }
360    
361            public void setUserId(long userId) {
362                    _userId = userId;
363            }
364    
365            public String getUserUuid() throws SystemException {
366                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
367            }
368    
369            public void setUserUuid(String userUuid) {
370                    _userUuid = userUuid;
371            }
372    
373            @JSON
374            public String getUserName() {
375                    if (_userName == null) {
376                            return StringPool.BLANK;
377                    }
378                    else {
379                            return _userName;
380                    }
381            }
382    
383            public void setUserName(String userName) {
384                    _userName = userName;
385            }
386    
387            @JSON
388            public Date getCreateDate() {
389                    return _createDate;
390            }
391    
392            public void setCreateDate(Date createDate) {
393                    _createDate = createDate;
394            }
395    
396            @JSON
397            public Date getModifiedDate() {
398                    return _modifiedDate;
399            }
400    
401            public void setModifiedDate(Date modifiedDate) {
402                    _modifiedDate = modifiedDate;
403            }
404    
405            @JSON
406            public String getName() {
407                    if (_name == null) {
408                            return StringPool.BLANK;
409                    }
410                    else {
411                            return _name;
412                    }
413            }
414    
415            public void setName(String name) {
416                    _columnBitmask = -1L;
417    
418                    if (_originalName == null) {
419                            _originalName = _name;
420                    }
421    
422                    _name = name;
423            }
424    
425            public String getOriginalName() {
426                    return GetterUtil.getString(_originalName);
427            }
428    
429            @JSON
430            public String getTitle() {
431                    if (_title == null) {
432                            return StringPool.BLANK;
433                    }
434                    else {
435                            return _title;
436                    }
437            }
438    
439            public String getTitle(Locale locale) {
440                    String languageId = LocaleUtil.toLanguageId(locale);
441    
442                    return getTitle(languageId);
443            }
444    
445            public String getTitle(Locale locale, boolean useDefault) {
446                    String languageId = LocaleUtil.toLanguageId(locale);
447    
448                    return getTitle(languageId, useDefault);
449            }
450    
451            public String getTitle(String languageId) {
452                    return LocalizationUtil.getLocalization(getTitle(), languageId);
453            }
454    
455            public String getTitle(String languageId, boolean useDefault) {
456                    return LocalizationUtil.getLocalization(getTitle(), languageId,
457                            useDefault);
458            }
459    
460            public String getTitleCurrentLanguageId() {
461                    return _titleCurrentLanguageId;
462            }
463    
464            @JSON
465            public String getTitleCurrentValue() {
466                    Locale locale = getLocale(_titleCurrentLanguageId);
467    
468                    return getTitle(locale);
469            }
470    
471            public Map<Locale, String> getTitleMap() {
472                    return LocalizationUtil.getLocalizationMap(getTitle());
473            }
474    
475            public void setTitle(String title) {
476                    _title = title;
477            }
478    
479            public void setTitle(String title, Locale locale) {
480                    setTitle(title, locale, LocaleUtil.getDefault());
481            }
482    
483            public void setTitle(String title, Locale locale, Locale defaultLocale) {
484                    String languageId = LocaleUtil.toLanguageId(locale);
485                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
486    
487                    if (Validator.isNotNull(title)) {
488                            setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
489                                            title, languageId, defaultLanguageId));
490                    }
491                    else {
492                            setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
493                                            languageId));
494                    }
495            }
496    
497            public void setTitleCurrentLanguageId(String languageId) {
498                    _titleCurrentLanguageId = languageId;
499            }
500    
501            public void setTitleMap(Map<Locale, String> titleMap) {
502                    setTitleMap(titleMap, LocaleUtil.getDefault());
503            }
504    
505            public void setTitleMap(Map<Locale, String> titleMap, Locale defaultLocale) {
506                    if (titleMap == null) {
507                            return;
508                    }
509    
510                    Locale[] locales = LanguageUtil.getAvailableLocales();
511    
512                    for (Locale locale : locales) {
513                            String title = titleMap.get(locale);
514    
515                            setTitle(title, locale, defaultLocale);
516                    }
517            }
518    
519            @JSON
520            public String getDescription() {
521                    if (_description == null) {
522                            return StringPool.BLANK;
523                    }
524                    else {
525                            return _description;
526                    }
527            }
528    
529            public String getDescription(Locale locale) {
530                    String languageId = LocaleUtil.toLanguageId(locale);
531    
532                    return getDescription(languageId);
533            }
534    
535            public String getDescription(Locale locale, boolean useDefault) {
536                    String languageId = LocaleUtil.toLanguageId(locale);
537    
538                    return getDescription(languageId, useDefault);
539            }
540    
541            public String getDescription(String languageId) {
542                    return LocalizationUtil.getLocalization(getDescription(), languageId);
543            }
544    
545            public String getDescription(String languageId, boolean useDefault) {
546                    return LocalizationUtil.getLocalization(getDescription(), languageId,
547                            useDefault);
548            }
549    
550            public String getDescriptionCurrentLanguageId() {
551                    return _descriptionCurrentLanguageId;
552            }
553    
554            @JSON
555            public String getDescriptionCurrentValue() {
556                    Locale locale = getLocale(_descriptionCurrentLanguageId);
557    
558                    return getDescription(locale);
559            }
560    
561            public Map<Locale, String> getDescriptionMap() {
562                    return LocalizationUtil.getLocalizationMap(getDescription());
563            }
564    
565            public void setDescription(String description) {
566                    _description = description;
567            }
568    
569            public void setDescription(String description, Locale locale) {
570                    setDescription(description, locale, LocaleUtil.getDefault());
571            }
572    
573            public void setDescription(String description, Locale locale,
574                    Locale defaultLocale) {
575                    String languageId = LocaleUtil.toLanguageId(locale);
576                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
577    
578                    if (Validator.isNotNull(description)) {
579                            setDescription(LocalizationUtil.updateLocalization(
580                                            getDescription(), "Description", description, languageId,
581                                            defaultLanguageId));
582                    }
583                    else {
584                            setDescription(LocalizationUtil.removeLocalization(
585                                            getDescription(), "Description", languageId));
586                    }
587            }
588    
589            public void setDescriptionCurrentLanguageId(String languageId) {
590                    _descriptionCurrentLanguageId = languageId;
591            }
592    
593            public void setDescriptionMap(Map<Locale, String> descriptionMap) {
594                    setDescriptionMap(descriptionMap, LocaleUtil.getDefault());
595            }
596    
597            public void setDescriptionMap(Map<Locale, String> descriptionMap,
598                    Locale defaultLocale) {
599                    if (descriptionMap == null) {
600                            return;
601                    }
602    
603                    Locale[] locales = LanguageUtil.getAvailableLocales();
604    
605                    for (Locale locale : locales) {
606                            String description = descriptionMap.get(locale);
607    
608                            setDescription(description, locale, defaultLocale);
609                    }
610            }
611    
612            @JSON
613            public String getSettings() {
614                    if (_settings == null) {
615                            return StringPool.BLANK;
616                    }
617                    else {
618                            return _settings;
619                    }
620            }
621    
622            public void setSettings(String settings) {
623                    _settings = settings;
624            }
625    
626            public long getColumnBitmask() {
627                    return _columnBitmask;
628            }
629    
630            @Override
631            public ExpandoBridge getExpandoBridge() {
632                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
633                            AssetVocabulary.class.getName(), getPrimaryKey());
634            }
635    
636            @Override
637            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
638                    ExpandoBridge expandoBridge = getExpandoBridge();
639    
640                    expandoBridge.setAttributes(serviceContext);
641            }
642    
643            @SuppressWarnings("unused")
644            public void prepareLocalizedFieldsForImport(Locale defaultImportLocale)
645                    throws LocaleException {
646                    setTitle(getTitle(defaultImportLocale), defaultImportLocale,
647                            defaultImportLocale);
648                    setDescription(getDescription(defaultImportLocale),
649                            defaultImportLocale, defaultImportLocale);
650            }
651    
652            @Override
653            public AssetVocabulary toEscapedModel() {
654                    if (_escapedModel == null) {
655                            _escapedModel = (AssetVocabulary)ProxyUtil.newProxyInstance(_classLoader,
656                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
657                    }
658    
659                    return _escapedModel;
660            }
661    
662            public AssetVocabulary toUnescapedModel() {
663                    return (AssetVocabulary)this;
664            }
665    
666            @Override
667            public Object clone() {
668                    AssetVocabularyImpl assetVocabularyImpl = new AssetVocabularyImpl();
669    
670                    assetVocabularyImpl.setUuid(getUuid());
671                    assetVocabularyImpl.setVocabularyId(getVocabularyId());
672                    assetVocabularyImpl.setGroupId(getGroupId());
673                    assetVocabularyImpl.setCompanyId(getCompanyId());
674                    assetVocabularyImpl.setUserId(getUserId());
675                    assetVocabularyImpl.setUserName(getUserName());
676                    assetVocabularyImpl.setCreateDate(getCreateDate());
677                    assetVocabularyImpl.setModifiedDate(getModifiedDate());
678                    assetVocabularyImpl.setName(getName());
679                    assetVocabularyImpl.setTitle(getTitle());
680                    assetVocabularyImpl.setDescription(getDescription());
681                    assetVocabularyImpl.setSettings(getSettings());
682    
683                    assetVocabularyImpl.resetOriginalValues();
684    
685                    return assetVocabularyImpl;
686            }
687    
688            public int compareTo(AssetVocabulary assetVocabulary) {
689                    int value = 0;
690    
691                    value = getName().compareTo(assetVocabulary.getName());
692    
693                    if (value != 0) {
694                            return value;
695                    }
696    
697                    return 0;
698            }
699    
700            @Override
701            public boolean equals(Object obj) {
702                    if (this == obj) {
703                            return true;
704                    }
705    
706                    if (!(obj instanceof AssetVocabulary)) {
707                            return false;
708                    }
709    
710                    AssetVocabulary assetVocabulary = (AssetVocabulary)obj;
711    
712                    long primaryKey = assetVocabulary.getPrimaryKey();
713    
714                    if (getPrimaryKey() == primaryKey) {
715                            return true;
716                    }
717                    else {
718                            return false;
719                    }
720            }
721    
722            @Override
723            public int hashCode() {
724                    return (int)getPrimaryKey();
725            }
726    
727            @Override
728            public void resetOriginalValues() {
729                    AssetVocabularyModelImpl assetVocabularyModelImpl = this;
730    
731                    assetVocabularyModelImpl._originalUuid = assetVocabularyModelImpl._uuid;
732    
733                    assetVocabularyModelImpl._originalGroupId = assetVocabularyModelImpl._groupId;
734    
735                    assetVocabularyModelImpl._setOriginalGroupId = false;
736    
737                    assetVocabularyModelImpl._originalCompanyId = assetVocabularyModelImpl._companyId;
738    
739                    assetVocabularyModelImpl._setOriginalCompanyId = false;
740    
741                    assetVocabularyModelImpl._originalName = assetVocabularyModelImpl._name;
742    
743                    assetVocabularyModelImpl._columnBitmask = 0;
744            }
745    
746            @Override
747            public CacheModel<AssetVocabulary> toCacheModel() {
748                    AssetVocabularyCacheModel assetVocabularyCacheModel = new AssetVocabularyCacheModel();
749    
750                    assetVocabularyCacheModel.uuid = getUuid();
751    
752                    String uuid = assetVocabularyCacheModel.uuid;
753    
754                    if ((uuid != null) && (uuid.length() == 0)) {
755                            assetVocabularyCacheModel.uuid = null;
756                    }
757    
758                    assetVocabularyCacheModel.vocabularyId = getVocabularyId();
759    
760                    assetVocabularyCacheModel.groupId = getGroupId();
761    
762                    assetVocabularyCacheModel.companyId = getCompanyId();
763    
764                    assetVocabularyCacheModel.userId = getUserId();
765    
766                    assetVocabularyCacheModel.userName = getUserName();
767    
768                    String userName = assetVocabularyCacheModel.userName;
769    
770                    if ((userName != null) && (userName.length() == 0)) {
771                            assetVocabularyCacheModel.userName = null;
772                    }
773    
774                    Date createDate = getCreateDate();
775    
776                    if (createDate != null) {
777                            assetVocabularyCacheModel.createDate = createDate.getTime();
778                    }
779                    else {
780                            assetVocabularyCacheModel.createDate = Long.MIN_VALUE;
781                    }
782    
783                    Date modifiedDate = getModifiedDate();
784    
785                    if (modifiedDate != null) {
786                            assetVocabularyCacheModel.modifiedDate = modifiedDate.getTime();
787                    }
788                    else {
789                            assetVocabularyCacheModel.modifiedDate = Long.MIN_VALUE;
790                    }
791    
792                    assetVocabularyCacheModel.name = getName();
793    
794                    String name = assetVocabularyCacheModel.name;
795    
796                    if ((name != null) && (name.length() == 0)) {
797                            assetVocabularyCacheModel.name = null;
798                    }
799    
800                    assetVocabularyCacheModel.title = getTitle();
801    
802                    String title = assetVocabularyCacheModel.title;
803    
804                    if ((title != null) && (title.length() == 0)) {
805                            assetVocabularyCacheModel.title = null;
806                    }
807    
808                    assetVocabularyCacheModel.description = getDescription();
809    
810                    String description = assetVocabularyCacheModel.description;
811    
812                    if ((description != null) && (description.length() == 0)) {
813                            assetVocabularyCacheModel.description = null;
814                    }
815    
816                    assetVocabularyCacheModel.settings = getSettings();
817    
818                    String settings = assetVocabularyCacheModel.settings;
819    
820                    if ((settings != null) && (settings.length() == 0)) {
821                            assetVocabularyCacheModel.settings = null;
822                    }
823    
824                    return assetVocabularyCacheModel;
825            }
826    
827            @Override
828            public String toString() {
829                    StringBundler sb = new StringBundler(25);
830    
831                    sb.append("{uuid=");
832                    sb.append(getUuid());
833                    sb.append(", vocabularyId=");
834                    sb.append(getVocabularyId());
835                    sb.append(", groupId=");
836                    sb.append(getGroupId());
837                    sb.append(", companyId=");
838                    sb.append(getCompanyId());
839                    sb.append(", userId=");
840                    sb.append(getUserId());
841                    sb.append(", userName=");
842                    sb.append(getUserName());
843                    sb.append(", createDate=");
844                    sb.append(getCreateDate());
845                    sb.append(", modifiedDate=");
846                    sb.append(getModifiedDate());
847                    sb.append(", name=");
848                    sb.append(getName());
849                    sb.append(", title=");
850                    sb.append(getTitle());
851                    sb.append(", description=");
852                    sb.append(getDescription());
853                    sb.append(", settings=");
854                    sb.append(getSettings());
855                    sb.append("}");
856    
857                    return sb.toString();
858            }
859    
860            public String toXmlString() {
861                    StringBundler sb = new StringBundler(40);
862    
863                    sb.append("<model><model-name>");
864                    sb.append("com.liferay.portlet.asset.model.AssetVocabulary");
865                    sb.append("</model-name>");
866    
867                    sb.append(
868                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
869                    sb.append(getUuid());
870                    sb.append("]]></column-value></column>");
871                    sb.append(
872                            "<column><column-name>vocabularyId</column-name><column-value><![CDATA[");
873                    sb.append(getVocabularyId());
874                    sb.append("]]></column-value></column>");
875                    sb.append(
876                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
877                    sb.append(getGroupId());
878                    sb.append("]]></column-value></column>");
879                    sb.append(
880                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
881                    sb.append(getCompanyId());
882                    sb.append("]]></column-value></column>");
883                    sb.append(
884                            "<column><column-name>userId</column-name><column-value><![CDATA[");
885                    sb.append(getUserId());
886                    sb.append("]]></column-value></column>");
887                    sb.append(
888                            "<column><column-name>userName</column-name><column-value><![CDATA[");
889                    sb.append(getUserName());
890                    sb.append("]]></column-value></column>");
891                    sb.append(
892                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
893                    sb.append(getCreateDate());
894                    sb.append("]]></column-value></column>");
895                    sb.append(
896                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
897                    sb.append(getModifiedDate());
898                    sb.append("]]></column-value></column>");
899                    sb.append(
900                            "<column><column-name>name</column-name><column-value><![CDATA[");
901                    sb.append(getName());
902                    sb.append("]]></column-value></column>");
903                    sb.append(
904                            "<column><column-name>title</column-name><column-value><![CDATA[");
905                    sb.append(getTitle());
906                    sb.append("]]></column-value></column>");
907                    sb.append(
908                            "<column><column-name>description</column-name><column-value><![CDATA[");
909                    sb.append(getDescription());
910                    sb.append("]]></column-value></column>");
911                    sb.append(
912                            "<column><column-name>settings</column-name><column-value><![CDATA[");
913                    sb.append(getSettings());
914                    sb.append("]]></column-value></column>");
915    
916                    sb.append("</model>");
917    
918                    return sb.toString();
919            }
920    
921            private static ClassLoader _classLoader = AssetVocabulary.class.getClassLoader();
922            private static Class<?>[] _escapedModelInterfaces = new Class[] {
923                            AssetVocabulary.class
924                    };
925            private String _uuid;
926            private String _originalUuid;
927            private long _vocabularyId;
928            private long _groupId;
929            private long _originalGroupId;
930            private boolean _setOriginalGroupId;
931            private long _companyId;
932            private long _originalCompanyId;
933            private boolean _setOriginalCompanyId;
934            private long _userId;
935            private String _userUuid;
936            private String _userName;
937            private Date _createDate;
938            private Date _modifiedDate;
939            private String _name;
940            private String _originalName;
941            private String _title;
942            private String _titleCurrentLanguageId;
943            private String _description;
944            private String _descriptionCurrentLanguageId;
945            private String _settings;
946            private long _columnBitmask;
947            private AssetVocabulary _escapedModel;
948    }