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