--- /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.blog.model.impl;
+
+import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
+import com.liferay.portal.kernel.exception.SystemException;
+import com.liferay.portal.kernel.util.GetterUtil;
+import com.liferay.portal.kernel.util.ProxyUtil;
+import com.liferay.portal.kernel.util.StringBundler;
+import com.liferay.portal.kernel.util.StringPool;
+import com.liferay.portal.model.CacheModel;
+import com.liferay.portal.model.impl.BaseModelImpl;
+import com.liferay.portal.service.ServiceContext;
+import com.liferay.portal.util.PortalUtil;
+
+import com.liferay.portlet.expando.model.ExpandoBridge;
+import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
+
+import com.pentila.entSavoie.blog.model.BlogChannel;
+import com.pentila.entSavoie.blog.model.BlogChannelModel;
+
+import java.io.Serializable;
+
+import java.sql.Types;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The base model implementation for the BlogChannel service. Represents a row in the "BlogPodcast_BlogChannel" database table, with each column mapped to a property of this class.
+ *
+ * <p>
+ * This implementation and its corresponding interface {@link com.pentila.entSavoie.blog.model.BlogChannelModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link BlogChannelImpl}.
+ * </p>
+ *
+ * @author Mathieu Amblard et Benjamin Apprederisse
+ * @see BlogChannelImpl
+ * @see com.pentila.entSavoie.blog.model.BlogChannel
+ * @see com.pentila.entSavoie.blog.model.BlogChannelModel
+ * @generated
+ */
+public class BlogChannelModelImpl extends BaseModelImpl<BlogChannel>
+ implements BlogChannelModel {
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. All methods that expect a blog channel model instance should use the {@link com.pentila.entSavoie.blog.model.BlogChannel} interface instead.
+ */
+ public static final String TABLE_NAME = "BlogPodcast_BlogChannel";
+ public static final Object[][] TABLE_COLUMNS = {
+ { "channelId", Types.BIGINT },
+ { "groupId", Types.BIGINT },
+ { "userId", Types.BIGINT },
+ { "title", Types.VARCHAR },
+ { "description", Types.VARCHAR },
+ { "pubDate", Types.TIMESTAMP },
+ { "lastBuildDate", Types.TIMESTAMP },
+ { "configuration", Types.VARCHAR },
+ { "topBand", Types.VARCHAR },
+ { "active_", Types.BOOLEAN }
+ };
+ public static final String TABLE_SQL_CREATE = "create table BlogPodcast_BlogChannel (channelId LONG not null primary key,groupId LONG,userId LONG,title VARCHAR(75) null,description VARCHAR(75) null,pubDate DATE null,lastBuildDate DATE null,configuration VARCHAR(75) null,topBand VARCHAR(75) null,active_ BOOLEAN)";
+ public static final String TABLE_SQL_DROP = "drop table BlogPodcast_BlogChannel";
+ public static final String DATA_SOURCE = "liferayDataSource";
+ public static final String SESSION_FACTORY = "liferaySessionFactory";
+ public static final String TX_MANAGER = "liferayTransactionManager";
+ public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
+ "value.object.entity.cache.enabled.com.pentila.entSavoie.blog.model.BlogChannel"),
+ true);
+ public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
+ "value.object.finder.cache.enabled.com.pentila.entSavoie.blog.model.BlogChannel"),
+ true);
+ public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
+ "value.object.column.bitmask.enabled.com.pentila.entSavoie.blog.model.BlogChannel"),
+ true);
+ public static long GROUPID_COLUMN_BITMASK = 1L;
+ public static long USERID_COLUMN_BITMASK = 2L;
+ public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
+ "lock.expiration.time.com.pentila.entSavoie.blog.model.BlogChannel"));
+
+ public BlogChannelModelImpl() {
+ }
+
+ public long getPrimaryKey() {
+ return _channelId;
+ }
+
+ public void setPrimaryKey(long primaryKey) {
+ setChannelId(primaryKey);
+ }
+
+ public Serializable getPrimaryKeyObj() {
+ return new Long(_channelId);
+ }
+
+ public void setPrimaryKeyObj(Serializable primaryKeyObj) {
+ setPrimaryKey(((Long)primaryKeyObj).longValue());
+ }
+
+ public Class<?> getModelClass() {
+ return BlogChannel.class;
+ }
+
+ public String getModelClassName() {
+ return BlogChannel.class.getName();
+ }
+
+ @Override
+ public Map<String, Object> getModelAttributes() {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+
+ attributes.put("channelId", getChannelId());
+ attributes.put("groupId", getGroupId());
+ attributes.put("userId", getUserId());
+ attributes.put("title", getTitle());
+ attributes.put("description", getDescription());
+ attributes.put("pubDate", getPubDate());
+ attributes.put("lastBuildDate", getLastBuildDate());
+ attributes.put("configuration", getConfiguration());
+ attributes.put("topBand", getTopBand());
+ attributes.put("active_", getActive_());
+
+ return attributes;
+ }
+
+ @Override
+ public void setModelAttributes(Map<String, Object> attributes) {
+ Long channelId = (Long)attributes.get("channelId");
+
+ if (channelId != null) {
+ setChannelId(channelId);
+ }
+
+ Long groupId = (Long)attributes.get("groupId");
+
+ if (groupId != null) {
+ setGroupId(groupId);
+ }
+
+ Long userId = (Long)attributes.get("userId");
+
+ if (userId != null) {
+ setUserId(userId);
+ }
+
+ String title = (String)attributes.get("title");
+
+ if (title != null) {
+ setTitle(title);
+ }
+
+ String description = (String)attributes.get("description");
+
+ if (description != null) {
+ setDescription(description);
+ }
+
+ Date pubDate = (Date)attributes.get("pubDate");
+
+ if (pubDate != null) {
+ setPubDate(pubDate);
+ }
+
+ Date lastBuildDate = (Date)attributes.get("lastBuildDate");
+
+ if (lastBuildDate != null) {
+ setLastBuildDate(lastBuildDate);
+ }
+
+ String configuration = (String)attributes.get("configuration");
+
+ if (configuration != null) {
+ setConfiguration(configuration);
+ }
+
+ String topBand = (String)attributes.get("topBand");
+
+ if (topBand != null) {
+ setTopBand(topBand);
+ }
+
+ Boolean active_ = (Boolean)attributes.get("active_");
+
+ if (active_ != null) {
+ setActive_(active_);
+ }
+ }
+
+ public long getChannelId() {
+ return _channelId;
+ }
+
+ public void setChannelId(long channelId) {
+ _channelId = channelId;
+ }
+
+ public long getGroupId() {
+ return _groupId;
+ }
+
+ public void setGroupId(long groupId) {
+ _columnBitmask |= GROUPID_COLUMN_BITMASK;
+
+ if (!_setOriginalGroupId) {
+ _setOriginalGroupId = true;
+
+ _originalGroupId = _groupId;
+ }
+
+ _groupId = groupId;
+ }
+
+ public long getOriginalGroupId() {
+ return _originalGroupId;
+ }
+
+ public long getUserId() {
+ return _userId;
+ }
+
+ public void setUserId(long userId) {
+ _columnBitmask |= USERID_COLUMN_BITMASK;
+
+ if (!_setOriginalUserId) {
+ _setOriginalUserId = true;
+
+ _originalUserId = _userId;
+ }
+
+ _userId = userId;
+ }
+
+ public String getUserUuid() throws SystemException {
+ return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
+ }
+
+ public void setUserUuid(String userUuid) {
+ _userUuid = userUuid;
+ }
+
+ public long getOriginalUserId() {
+ return _originalUserId;
+ }
+
+ public String getTitle() {
+ if (_title == null) {
+ return StringPool.BLANK;
+ }
+ else {
+ return _title;
+ }
+ }
+
+ public void setTitle(String title) {
+ _title = title;
+ }
+
+ public String getDescription() {
+ if (_description == null) {
+ return StringPool.BLANK;
+ }
+ else {
+ return _description;
+ }
+ }
+
+ public void setDescription(String description) {
+ _description = description;
+ }
+
+ 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 String getConfiguration() {
+ if (_configuration == null) {
+ return StringPool.BLANK;
+ }
+ else {
+ return _configuration;
+ }
+ }
+
+ public void setConfiguration(String configuration) {
+ _configuration = configuration;
+ }
+
+ public String getTopBand() {
+ if (_topBand == null) {
+ return StringPool.BLANK;
+ }
+ else {
+ return _topBand;
+ }
+ }
+
+ public void setTopBand(String topBand) {
+ _topBand = topBand;
+ }
+
+ public boolean getActive_() {
+ return _active_;
+ }
+
+ public boolean isActive_() {
+ return _active_;
+ }
+
+ public void setActive_(boolean active_) {
+ _active_ = active_;
+ }
+
+ public long getColumnBitmask() {
+ return _columnBitmask;
+ }
+
+ @Override
+ public ExpandoBridge getExpandoBridge() {
+ return ExpandoBridgeFactoryUtil.getExpandoBridge(0,
+ BlogChannel.class.getName(), getPrimaryKey());
+ }
+
+ @Override
+ public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
+ ExpandoBridge expandoBridge = getExpandoBridge();
+
+ expandoBridge.setAttributes(serviceContext);
+ }
+
+ @Override
+ public BlogChannel toEscapedModel() {
+ if (_escapedModelProxy == null) {
+ _escapedModelProxy = (BlogChannel)ProxyUtil.newProxyInstance(_classLoader,
+ _escapedModelProxyInterfaces,
+ new AutoEscapeBeanHandler(this));
+ }
+
+ return _escapedModelProxy;
+ }
+
+ @Override
+ public Object clone() {
+ BlogChannelImpl blogChannelImpl = new BlogChannelImpl();
+
+ blogChannelImpl.setChannelId(getChannelId());
+ blogChannelImpl.setGroupId(getGroupId());
+ blogChannelImpl.setUserId(getUserId());
+ blogChannelImpl.setTitle(getTitle());
+ blogChannelImpl.setDescription(getDescription());
+ blogChannelImpl.setPubDate(getPubDate());
+ blogChannelImpl.setLastBuildDate(getLastBuildDate());
+ blogChannelImpl.setConfiguration(getConfiguration());
+ blogChannelImpl.setTopBand(getTopBand());
+ blogChannelImpl.setActive_(getActive_());
+
+ blogChannelImpl.resetOriginalValues();
+
+ return blogChannelImpl;
+ }
+
+ public int compareTo(BlogChannel blogChannel) {
+ long primaryKey = blogChannel.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;
+ }
+
+ BlogChannel blogChannel = null;
+
+ try {
+ blogChannel = (BlogChannel)obj;
+ }
+ catch (ClassCastException cce) {
+ return false;
+ }
+
+ long primaryKey = blogChannel.getPrimaryKey();
+
+ if (getPrimaryKey() == primaryKey) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return (int)getPrimaryKey();
+ }
+
+ @Override
+ public void resetOriginalValues() {
+ BlogChannelModelImpl blogChannelModelImpl = this;
+
+ blogChannelModelImpl._originalGroupId = blogChannelModelImpl._groupId;
+
+ blogChannelModelImpl._setOriginalGroupId = false;
+
+ blogChannelModelImpl._originalUserId = blogChannelModelImpl._userId;
+
+ blogChannelModelImpl._setOriginalUserId = false;
+
+ blogChannelModelImpl._columnBitmask = 0;
+ }
+
+ @Override
+ public CacheModel<BlogChannel> toCacheModel() {
+ BlogChannelCacheModel blogChannelCacheModel = new BlogChannelCacheModel();
+
+ blogChannelCacheModel.channelId = getChannelId();
+
+ blogChannelCacheModel.groupId = getGroupId();
+
+ blogChannelCacheModel.userId = getUserId();
+
+ blogChannelCacheModel.title = getTitle();
+
+ String title = blogChannelCacheModel.title;
+
+ if ((title != null) && (title.length() == 0)) {
+ blogChannelCacheModel.title = null;
+ }
+
+ blogChannelCacheModel.description = getDescription();
+
+ String description = blogChannelCacheModel.description;
+
+ if ((description != null) && (description.length() == 0)) {
+ blogChannelCacheModel.description = null;
+ }
+
+ Date pubDate = getPubDate();
+
+ if (pubDate != null) {
+ blogChannelCacheModel.pubDate = pubDate.getTime();
+ }
+ else {
+ blogChannelCacheModel.pubDate = Long.MIN_VALUE;
+ }
+
+ Date lastBuildDate = getLastBuildDate();
+
+ if (lastBuildDate != null) {
+ blogChannelCacheModel.lastBuildDate = lastBuildDate.getTime();
+ }
+ else {
+ blogChannelCacheModel.lastBuildDate = Long.MIN_VALUE;
+ }
+
+ blogChannelCacheModel.configuration = getConfiguration();
+
+ String configuration = blogChannelCacheModel.configuration;
+
+ if ((configuration != null) && (configuration.length() == 0)) {
+ blogChannelCacheModel.configuration = null;
+ }
+
+ blogChannelCacheModel.topBand = getTopBand();
+
+ String topBand = blogChannelCacheModel.topBand;
+
+ if ((topBand != null) && (topBand.length() == 0)) {
+ blogChannelCacheModel.topBand = null;
+ }
+
+ blogChannelCacheModel.active_ = getActive_();
+
+ return blogChannelCacheModel;
+ }
+
+ @Override
+ public String toString() {
+ StringBundler sb = new StringBundler(21);
+
+ sb.append("{channelId=");
+ sb.append(getChannelId());
+ sb.append(", groupId=");
+ sb.append(getGroupId());
+ sb.append(", userId=");
+ sb.append(getUserId());
+ sb.append(", title=");
+ sb.append(getTitle());
+ sb.append(", description=");
+ sb.append(getDescription());
+ sb.append(", pubDate=");
+ sb.append(getPubDate());
+ sb.append(", lastBuildDate=");
+ sb.append(getLastBuildDate());
+ sb.append(", configuration=");
+ sb.append(getConfiguration());
+ sb.append(", topBand=");
+ sb.append(getTopBand());
+ sb.append(", active_=");
+ sb.append(getActive_());
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ public String toXmlString() {
+ StringBundler sb = new StringBundler(34);
+
+ sb.append("<model><model-name>");
+ sb.append("com.pentila.entSavoie.blog.model.BlogChannel");
+ sb.append("</model-name>");
+
+ sb.append(
+ "<column><column-name>channelId</column-name><column-value><![CDATA[");
+ sb.append(getChannelId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>groupId</column-name><column-value><![CDATA[");
+ sb.append(getGroupId());
+ 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>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>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>configuration</column-name><column-value><![CDATA[");
+ sb.append(getConfiguration());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>topBand</column-name><column-value><![CDATA[");
+ sb.append(getTopBand());
+ 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 static ClassLoader _classLoader = BlogChannel.class.getClassLoader();
+ private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
+ BlogChannel.class
+ };
+ private long _channelId;
+ private long _groupId;
+ private long _originalGroupId;
+ private boolean _setOriginalGroupId;
+ private long _userId;
+ private String _userUuid;
+ private long _originalUserId;
+ private boolean _setOriginalUserId;
+ private String _title;
+ private String _description;
+ private Date _pubDate;
+ private Date _lastBuildDate;
+ private String _configuration;
+ private String _topBand;
+ private boolean _active_;
+ private long _columnBitmask;
+ private BlogChannel _escapedModelProxy;
+}
\ No newline at end of file