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