/** * Copyright (c) 2000-present 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 de.uhh.l2g.plugins.migration.model.impl; import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler; 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.model.CacheModel; import com.liferay.portal.model.impl.BaseModelImpl; import com.liferay.portal.service.ServiceContext; import com.liferay.portlet.expando.model.ExpandoBridge; import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil; import de.uhh.l2g.plugins.migration.model.LegacyVideoHitlist; import de.uhh.l2g.plugins.migration.model.LegacyVideoHitlistModel; import java.io.Serializable; import java.sql.Types; import java.util.HashMap; import java.util.Map; /** * The base model implementation for the LegacyVideoHitlist service. Represents a row in the "videohitlist" database table, with each column mapped to a property of this class. * * <p> * This implementation and its corresponding interface {@link de.uhh.l2g.plugins.migration.model.LegacyVideoHitlistModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link LegacyVideoHitlistImpl}. * </p> * * @author unihh * @see LegacyVideoHitlistImpl * @see de.uhh.l2g.plugins.migration.model.LegacyVideoHitlist * @see de.uhh.l2g.plugins.migration.model.LegacyVideoHitlistModel * @generated */ public class LegacyVideoHitlistModelImpl extends BaseModelImpl<LegacyVideoHitlist> implements LegacyVideoHitlistModel { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this class directly. All methods that expect a legacy video hitlist model instance should use the {@link de.uhh.l2g.plugins.migration.model.LegacyVideoHitlist} interface instead. */ public static final String TABLE_NAME = "videohitlist"; public static final Object[][] TABLE_COLUMNS = { { "id_", Types.BIGINT }, { "hitsperday", Types.BIGINT }, { "hitsperweek", Types.BIGINT }, { "hitspermonth", Types.BIGINT }, { "hitsperyear", Types.BIGINT } }; public static final String TABLE_SQL_CREATE = "create table videohitlist (id_ LONG not null primary key,hitsperday LONG,hitsperweek LONG,hitspermonth LONG,hitsperyear LONG)"; public static final String TABLE_SQL_DROP = "drop table videohitlist"; public static final String ORDER_BY_JPQL = " ORDER BY legacyVideoHitlist.id ASC"; public static final String ORDER_BY_SQL = " ORDER BY videohitlist.id_ ASC"; public static final String DATA_SOURCE = "anotherDataSource"; public static final String SESSION_FACTORY = "anotherSessionFactory"; public static final String TX_MANAGER = "anotherTransactionManager"; public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get( "value.object.entity.cache.enabled.de.uhh.l2g.plugins.migration.model.LegacyVideoHitlist"), true); public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get( "value.object.finder.cache.enabled.de.uhh.l2g.plugins.migration.model.LegacyVideoHitlist"), true); public static final boolean COLUMN_BITMASK_ENABLED = false; public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get( "lock.expiration.time.de.uhh.l2g.plugins.migration.model.LegacyVideoHitlist")); public LegacyVideoHitlistModelImpl() { } @Override public long getPrimaryKey() { return _id; } @Override public void setPrimaryKey(long primaryKey) { setId(primaryKey); } @Override public Serializable getPrimaryKeyObj() { return _id; } @Override public void setPrimaryKeyObj(Serializable primaryKeyObj) { setPrimaryKey(((Long)primaryKeyObj).longValue()); } @Override public Class<?> getModelClass() { return LegacyVideoHitlist.class; } @Override public String getModelClassName() { return LegacyVideoHitlist.class.getName(); } @Override public Map<String, Object> getModelAttributes() { Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put("id", getId()); attributes.put("hitsperday", getHitsperday()); attributes.put("hitsperweek", getHitsperweek()); attributes.put("hitspermonth", getHitspermonth()); attributes.put("hitsperyear", getHitsperyear()); return attributes; } @Override public void setModelAttributes(Map<String, Object> attributes) { Long id = (Long)attributes.get("id"); if (id != null) { setId(id); } Long hitsperday = (Long)attributes.get("hitsperday"); if (hitsperday != null) { setHitsperday(hitsperday); } Long hitsperweek = (Long)attributes.get("hitsperweek"); if (hitsperweek != null) { setHitsperweek(hitsperweek); } Long hitspermonth = (Long)attributes.get("hitspermonth"); if (hitspermonth != null) { setHitspermonth(hitspermonth); } Long hitsperyear = (Long)attributes.get("hitsperyear"); if (hitsperyear != null) { setHitsperyear(hitsperyear); } } @Override public long getId() { return _id; } @Override public void setId(long id) { _id = id; } @Override public long getHitsperday() { return _hitsperday; } @Override public void setHitsperday(long hitsperday) { _hitsperday = hitsperday; } @Override public long getHitsperweek() { return _hitsperweek; } @Override public void setHitsperweek(long hitsperweek) { _hitsperweek = hitsperweek; } @Override public long getHitspermonth() { return _hitspermonth; } @Override public void setHitspermonth(long hitspermonth) { _hitspermonth = hitspermonth; } @Override public long getHitsperyear() { return _hitsperyear; } @Override public void setHitsperyear(long hitsperyear) { _hitsperyear = hitsperyear; } @Override public ExpandoBridge getExpandoBridge() { return ExpandoBridgeFactoryUtil.getExpandoBridge(0, LegacyVideoHitlist.class.getName(), getPrimaryKey()); } @Override public void setExpandoBridgeAttributes(ServiceContext serviceContext) { ExpandoBridge expandoBridge = getExpandoBridge(); expandoBridge.setAttributes(serviceContext); } @Override public LegacyVideoHitlist toEscapedModel() { if (_escapedModel == null) { _escapedModel = (LegacyVideoHitlist)ProxyUtil.newProxyInstance(_classLoader, _escapedModelInterfaces, new AutoEscapeBeanHandler(this)); } return _escapedModel; } @Override public Object clone() { LegacyVideoHitlistImpl legacyVideoHitlistImpl = new LegacyVideoHitlistImpl(); legacyVideoHitlistImpl.setId(getId()); legacyVideoHitlistImpl.setHitsperday(getHitsperday()); legacyVideoHitlistImpl.setHitsperweek(getHitsperweek()); legacyVideoHitlistImpl.setHitspermonth(getHitspermonth()); legacyVideoHitlistImpl.setHitsperyear(getHitsperyear()); legacyVideoHitlistImpl.resetOriginalValues(); return legacyVideoHitlistImpl; } @Override public int compareTo(LegacyVideoHitlist legacyVideoHitlist) { long primaryKey = legacyVideoHitlist.getPrimaryKey(); if (getPrimaryKey() < primaryKey) { return -1; } else if (getPrimaryKey() > primaryKey) { return 1; } else { return 0; } } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof LegacyVideoHitlist)) { return false; } LegacyVideoHitlist legacyVideoHitlist = (LegacyVideoHitlist)obj; long primaryKey = legacyVideoHitlist.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } } @Override public int hashCode() { return (int)getPrimaryKey(); } @Override public void resetOriginalValues() { } @Override public CacheModel<LegacyVideoHitlist> toCacheModel() { LegacyVideoHitlistCacheModel legacyVideoHitlistCacheModel = new LegacyVideoHitlistCacheModel(); legacyVideoHitlistCacheModel.id = getId(); legacyVideoHitlistCacheModel.hitsperday = getHitsperday(); legacyVideoHitlistCacheModel.hitsperweek = getHitsperweek(); legacyVideoHitlistCacheModel.hitspermonth = getHitspermonth(); legacyVideoHitlistCacheModel.hitsperyear = getHitsperyear(); return legacyVideoHitlistCacheModel; } @Override public String toString() { StringBundler sb = new StringBundler(11); sb.append("{id="); sb.append(getId()); sb.append(", hitsperday="); sb.append(getHitsperday()); sb.append(", hitsperweek="); sb.append(getHitsperweek()); sb.append(", hitspermonth="); sb.append(getHitspermonth()); sb.append(", hitsperyear="); sb.append(getHitsperyear()); sb.append("}"); return sb.toString(); } @Override public String toXmlString() { StringBundler sb = new StringBundler(19); sb.append("<model><model-name>"); sb.append("de.uhh.l2g.plugins.migration.model.LegacyVideoHitlist"); sb.append("</model-name>"); sb.append( "<column><column-name>id</column-name><column-value><![CDATA["); sb.append(getId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>hitsperday</column-name><column-value><![CDATA["); sb.append(getHitsperday()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>hitsperweek</column-name><column-value><![CDATA["); sb.append(getHitsperweek()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>hitspermonth</column-name><column-value><![CDATA["); sb.append(getHitspermonth()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>hitsperyear</column-name><column-value><![CDATA["); sb.append(getHitsperyear()); sb.append("]]></column-value></column>"); sb.append("</model>"); return sb.toString(); } private static ClassLoader _classLoader = LegacyVideoHitlist.class.getClassLoader(); private static Class<?>[] _escapedModelInterfaces = new Class[] { LegacyVideoHitlist.class }; private long _id; private long _hitsperday; private long _hitsperweek; private long _hitspermonth; private long _hitsperyear; private LegacyVideoHitlist _escapedModel; }