--- /dev/null
+/**
+ * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package com.pentila.entSavoie.internalMessaging.model;
+
+import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
+import com.liferay.portal.kernel.exception.SystemException;
+import com.liferay.portal.kernel.util.StringBundler;
+import com.liferay.portal.model.BaseModel;
+import com.liferay.portal.model.impl.BaseModelImpl;
+import com.liferay.portal.util.PortalUtil;
+
+import com.pentila.entSavoie.internalMessaging.service.RssChanelLocalServiceUtil;
+
+import java.io.Serializable;
+
+import java.lang.reflect.Proxy;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Igor Barma - Mathieu Amblard
+ */
+public class RssChanelClp extends BaseModelImpl<RssChanel> implements RssChanel {
+ public RssChanelClp() {
+ }
+
+ public Class<?> getModelClass() {
+ return RssChanel.class;
+ }
+
+ public String getModelClassName() {
+ return RssChanel.class.getName();
+ }
+
+ public long getPrimaryKey() {
+ return _chanelId;
+ }
+
+ public void setPrimaryKey(long primaryKey) {
+ setChanelId(primaryKey);
+ }
+
+ public Serializable getPrimaryKeyObj() {
+ return new Long(_chanelId);
+ }
+
+ public void setPrimaryKeyObj(Serializable primaryKeyObj) {
+ setPrimaryKey(((Long)primaryKeyObj).longValue());
+ }
+
+ @Override
+ public Map<String, Object> getModelAttributes() {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+
+ attributes.put("chanelId", getChanelId());
+ attributes.put("userId", getUserId());
+ attributes.put("url", getUrl());
+ attributes.put("title", getTitle());
+ attributes.put("description", getDescription());
+ attributes.put("link", getLink());
+ attributes.put("urlImage", getUrlImage());
+ attributes.put("pubDate", getPubDate());
+ attributes.put("lastBuildDate", getLastBuildDate());
+ attributes.put("lastUpdateDate", getLastUpdateDate());
+ attributes.put("active", getActive());
+
+ return attributes;
+ }
+
+ @Override
+ public void setModelAttributes(Map<String, Object> attributes) {
+ Long chanelId = (Long)attributes.get("chanelId");
+
+ if (chanelId != null) {
+ setChanelId(chanelId);
+ }
+
+ Long userId = (Long)attributes.get("userId");
+
+ if (userId != null) {
+ setUserId(userId);
+ }
+
+ String url = (String)attributes.get("url");
+
+ if (url != null) {
+ setUrl(url);
+ }
+
+ String title = (String)attributes.get("title");
+
+ if (title != null) {
+ setTitle(title);
+ }
+
+ String description = (String)attributes.get("description");
+
+ if (description != null) {
+ setDescription(description);
+ }
+
+ String link = (String)attributes.get("link");
+
+ if (link != null) {
+ setLink(link);
+ }
+
+ String urlImage = (String)attributes.get("urlImage");
+
+ if (urlImage != null) {
+ setUrlImage(urlImage);
+ }
+
+ Date pubDate = (Date)attributes.get("pubDate");
+
+ if (pubDate != null) {
+ setPubDate(pubDate);
+ }
+
+ Date lastBuildDate = (Date)attributes.get("lastBuildDate");
+
+ if (lastBuildDate != null) {
+ setLastBuildDate(lastBuildDate);
+ }
+
+ Date lastUpdateDate = (Date)attributes.get("lastUpdateDate");
+
+ if (lastUpdateDate != null) {
+ setLastUpdateDate(lastUpdateDate);
+ }
+
+ Boolean active = (Boolean)attributes.get("active");
+
+ if (active != null) {
+ setActive(active);
+ }
+ }
+
+ public long getChanelId() {
+ return _chanelId;
+ }
+
+ public void setChanelId(long chanelId) {
+ _chanelId = chanelId;
+ }
+
+ public long getUserId() {
+ return _userId;
+ }
+
+ public void setUserId(long userId) {
+ _userId = userId;
+ }
+
+ public String getUserUuid() throws SystemException {
+ return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
+ }
+
+ public void setUserUuid(String userUuid) {
+ _userUuid = userUuid;
+ }
+
+ public String getUrl() {
+ return _url;
+ }
+
+ public void setUrl(String url) {
+ _url = url;
+ }
+
+ public String getTitle() {
+ return _title;
+ }
+
+ public void setTitle(String title) {
+ _title = title;
+ }
+
+ public String getDescription() {
+ return _description;
+ }
+
+ public void setDescription(String description) {
+ _description = description;
+ }
+
+ public String getLink() {
+ return _link;
+ }
+
+ public void setLink(String link) {
+ _link = link;
+ }
+
+ public String getUrlImage() {
+ return _urlImage;
+ }
+
+ public void setUrlImage(String urlImage) {
+ _urlImage = urlImage;
+ }
+
+ public Date getPubDate() {
+ return _pubDate;
+ }
+
+ public void setPubDate(Date pubDate) {
+ _pubDate = pubDate;
+ }
+
+ public Date getLastBuildDate() {
+ return _lastBuildDate;
+ }
+
+ public void setLastBuildDate(Date lastBuildDate) {
+ _lastBuildDate = lastBuildDate;
+ }
+
+ public Date getLastUpdateDate() {
+ return _lastUpdateDate;
+ }
+
+ public void setLastUpdateDate(Date lastUpdateDate) {
+ _lastUpdateDate = lastUpdateDate;
+ }
+
+ public boolean getActive() {
+ return _active;
+ }
+
+ public boolean isActive() {
+ return _active;
+ }
+
+ public void setActive(boolean active) {
+ _active = active;
+ }
+
+ public BaseModel<?> getRssChanelRemoteModel() {
+ return _rssChanelRemoteModel;
+ }
+
+ public void setRssChanelRemoteModel(BaseModel<?> rssChanelRemoteModel) {
+ _rssChanelRemoteModel = rssChanelRemoteModel;
+ }
+
+ public void persist() throws SystemException {
+ if (this.isNew()) {
+ RssChanelLocalServiceUtil.addRssChanel(this);
+ }
+ else {
+ RssChanelLocalServiceUtil.updateRssChanel(this);
+ }
+ }
+
+ @Override
+ public RssChanel toEscapedModel() {
+ return (RssChanel)Proxy.newProxyInstance(RssChanel.class.getClassLoader(),
+ new Class[] { RssChanel.class }, new AutoEscapeBeanHandler(this));
+ }
+
+ @Override
+ public Object clone() {
+ RssChanelClp clone = new RssChanelClp();
+
+ clone.setChanelId(getChanelId());
+ clone.setUserId(getUserId());
+ clone.setUrl(getUrl());
+ clone.setTitle(getTitle());
+ clone.setDescription(getDescription());
+ clone.setLink(getLink());
+ clone.setUrlImage(getUrlImage());
+ clone.setPubDate(getPubDate());
+ clone.setLastBuildDate(getLastBuildDate());
+ clone.setLastUpdateDate(getLastUpdateDate());
+ clone.setActive(getActive());
+
+ return clone;
+ }
+
+ public int compareTo(RssChanel rssChanel) {
+ long primaryKey = rssChanel.getPrimaryKey();
+
+ if (getPrimaryKey() < primaryKey) {
+ return -1;
+ }
+ else if (getPrimaryKey() > primaryKey) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+
+ RssChanelClp rssChanel = null;
+
+ try {
+ rssChanel = (RssChanelClp)obj;
+ }
+ catch (ClassCastException cce) {
+ return false;
+ }
+
+ long primaryKey = rssChanel.getPrimaryKey();
+
+ if (getPrimaryKey() == primaryKey) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return (int)getPrimaryKey();
+ }
+
+ @Override
+ public String toString() {
+ StringBundler sb = new StringBundler(23);
+
+ sb.append("{chanelId=");
+ sb.append(getChanelId());
+ sb.append(", userId=");
+ sb.append(getUserId());
+ sb.append(", url=");
+ sb.append(getUrl());
+ sb.append(", title=");
+ sb.append(getTitle());
+ sb.append(", description=");
+ sb.append(getDescription());
+ sb.append(", link=");
+ sb.append(getLink());
+ sb.append(", urlImage=");
+ sb.append(getUrlImage());
+ sb.append(", pubDate=");
+ sb.append(getPubDate());
+ sb.append(", lastBuildDate=");
+ sb.append(getLastBuildDate());
+ sb.append(", lastUpdateDate=");
+ sb.append(getLastUpdateDate());
+ sb.append(", active=");
+ sb.append(getActive());
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ public String toXmlString() {
+ StringBundler sb = new StringBundler(37);
+
+ sb.append("<model><model-name>");
+ sb.append("com.pentila.entSavoie.internalMessaging.model.RssChanel");
+ sb.append("</model-name>");
+
+ sb.append(
+ "<column><column-name>chanelId</column-name><column-value><![CDATA[");
+ sb.append(getChanelId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>userId</column-name><column-value><![CDATA[");
+ sb.append(getUserId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>url</column-name><column-value><![CDATA[");
+ sb.append(getUrl());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>title</column-name><column-value><![CDATA[");
+ sb.append(getTitle());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>description</column-name><column-value><![CDATA[");
+ sb.append(getDescription());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>link</column-name><column-value><![CDATA[");
+ sb.append(getLink());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>urlImage</column-name><column-value><![CDATA[");
+ sb.append(getUrlImage());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>pubDate</column-name><column-value><![CDATA[");
+ sb.append(getPubDate());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>lastBuildDate</column-name><column-value><![CDATA[");
+ sb.append(getLastBuildDate());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>lastUpdateDate</column-name><column-value><![CDATA[");
+ sb.append(getLastUpdateDate());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>active</column-name><column-value><![CDATA[");
+ sb.append(getActive());
+ sb.append("]]></column-value></column>");
+
+ sb.append("</model>");
+
+ return sb.toString();
+ }
+
+ private long _chanelId;
+ private long _userId;
+ private String _userUuid;
+ private String _url;
+ private String _title;
+ private String _description;
+ private String _link;
+ private String _urlImage;
+ private Date _pubDate;
+ private Date _lastBuildDate;
+ private Date _lastUpdateDate;
+ private boolean _active;
+ private BaseModel<?> _rssChanelRemoteModel;
+}
\ No newline at end of file