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