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