/** * 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.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.portlet.expando.model.ExpandoBridge; import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil; import de.uhh.l2g.plugins.migration.model.LegacyVideo; import de.uhh.l2g.plugins.migration.model.LegacyVideoModel; 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 LegacyVideo service. Represents a row in the "video" 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.LegacyVideoModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link LegacyVideoImpl}. * </p> * * @author unihh * @see LegacyVideoImpl * @see de.uhh.l2g.plugins.migration.model.LegacyVideo * @see de.uhh.l2g.plugins.migration.model.LegacyVideoModel * @generated */ public class LegacyVideoModelImpl extends BaseModelImpl<LegacyVideo> implements LegacyVideoModel { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this class directly. All methods that expect a legacy video model instance should use the {@link de.uhh.l2g.plugins.migration.model.LegacyVideo} interface instead. */ public static final String TABLE_NAME = "video"; public static final Object[][] TABLE_COLUMNS = { { "id_", Types.BIGINT }, { "title", Types.VARCHAR }, { "tags", Types.VARCHAR }, { "lectureseriesId", Types.BIGINT }, { "ownerId", Types.BIGINT }, { "producerId", Types.BIGINT }, { "containerFormat", Types.VARCHAR }, { "filename", Types.VARCHAR }, { "resolution", Types.VARCHAR }, { "duration", Types.VARCHAR }, { "hostId", Types.BIGINT }, { "textId", Types.BIGINT }, { "fileSize", Types.VARCHAR }, { "generationDate", Types.VARCHAR }, { "openAccess", Types.INTEGER }, { "downloadLink", Types.INTEGER }, { "metadataId", Types.BIGINT }, { "surl", Types.VARCHAR }, { "hits", Types.BIGINT }, { "uploadDate", Types.TIMESTAMP }, { "permittedToSegment", Types.INTEGER }, { "facilityId", Types.BIGINT }, { "citation2go", Types.INTEGER } }; public static final String TABLE_SQL_CREATE = "create table video (id_ LONG not null primary key,title VARCHAR(75) null,tags VARCHAR(75) null,lectureseriesId LONG,ownerId LONG,producerId LONG,containerFormat VARCHAR(75) null,filename VARCHAR(75) null,resolution VARCHAR(75) null,duration VARCHAR(75) null,hostId LONG,textId LONG,fileSize VARCHAR(75) null,generationDate VARCHAR(75) null,openAccess INTEGER,downloadLink INTEGER,metadataId LONG,surl VARCHAR(75) null,hits LONG,uploadDate DATE null,permittedToSegment INTEGER,facilityId LONG,citation2go INTEGER)"; public static final String TABLE_SQL_DROP = "drop table video"; public static final String ORDER_BY_JPQL = " ORDER BY legacyVideo.id ASC"; public static final String ORDER_BY_SQL = " ORDER BY video.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.LegacyVideo"), 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.LegacyVideo"), 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.LegacyVideo")); public LegacyVideoModelImpl() { } @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 LegacyVideo.class; } @Override public String getModelClassName() { return LegacyVideo.class.getName(); } @Override public Map<String, Object> getModelAttributes() { Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put("id", getId()); attributes.put("title", getTitle()); attributes.put("tags", getTags()); attributes.put("lectureseriesId", getLectureseriesId()); attributes.put("ownerId", getOwnerId()); attributes.put("producerId", getProducerId()); attributes.put("containerFormat", getContainerFormat()); attributes.put("filename", getFilename()); attributes.put("resolution", getResolution()); attributes.put("duration", getDuration()); attributes.put("hostId", getHostId()); attributes.put("textId", getTextId()); attributes.put("fileSize", getFileSize()); attributes.put("generationDate", getGenerationDate()); attributes.put("openAccess", getOpenAccess()); attributes.put("downloadLink", getDownloadLink()); attributes.put("metadataId", getMetadataId()); attributes.put("surl", getSurl()); attributes.put("hits", getHits()); attributes.put("uploadDate", getUploadDate()); attributes.put("permittedToSegment", getPermittedToSegment()); attributes.put("facilityId", getFacilityId()); attributes.put("citation2go", getCitation2go()); return attributes; } @Override public void setModelAttributes(Map<String, Object> attributes) { Long id = (Long)attributes.get("id"); if (id != null) { setId(id); } String title = (String)attributes.get("title"); if (title != null) { setTitle(title); } String tags = (String)attributes.get("tags"); if (tags != null) { setTags(tags); } Long lectureseriesId = (Long)attributes.get("lectureseriesId"); if (lectureseriesId != null) { setLectureseriesId(lectureseriesId); } Long ownerId = (Long)attributes.get("ownerId"); if (ownerId != null) { setOwnerId(ownerId); } Long producerId = (Long)attributes.get("producerId"); if (producerId != null) { setProducerId(producerId); } String containerFormat = (String)attributes.get("containerFormat"); if (containerFormat != null) { setContainerFormat(containerFormat); } String filename = (String)attributes.get("filename"); if (filename != null) { setFilename(filename); } String resolution = (String)attributes.get("resolution"); if (resolution != null) { setResolution(resolution); } String duration = (String)attributes.get("duration"); if (duration != null) { setDuration(duration); } Long hostId = (Long)attributes.get("hostId"); if (hostId != null) { setHostId(hostId); } Long textId = (Long)attributes.get("textId"); if (textId != null) { setTextId(textId); } String fileSize = (String)attributes.get("fileSize"); if (fileSize != null) { setFileSize(fileSize); } String generationDate = (String)attributes.get("generationDate"); if (generationDate != null) { setGenerationDate(generationDate); } Integer openAccess = (Integer)attributes.get("openAccess"); if (openAccess != null) { setOpenAccess(openAccess); } Integer downloadLink = (Integer)attributes.get("downloadLink"); if (downloadLink != null) { setDownloadLink(downloadLink); } Long metadataId = (Long)attributes.get("metadataId"); if (metadataId != null) { setMetadataId(metadataId); } String surl = (String)attributes.get("surl"); if (surl != null) { setSurl(surl); } Long hits = (Long)attributes.get("hits"); if (hits != null) { setHits(hits); } Date uploadDate = (Date)attributes.get("uploadDate"); if (uploadDate != null) { setUploadDate(uploadDate); } Integer permittedToSegment = (Integer)attributes.get( "permittedToSegment"); if (permittedToSegment != null) { setPermittedToSegment(permittedToSegment); } Long facilityId = (Long)attributes.get("facilityId"); if (facilityId != null) { setFacilityId(facilityId); } Integer citation2go = (Integer)attributes.get("citation2go"); if (citation2go != null) { setCitation2go(citation2go); } } @Override public long getId() { return _id; } @Override public void setId(long id) { _id = id; } @Override public String getTitle() { if (_title == null) { return StringPool.BLANK; } else { return _title; } } @Override public void setTitle(String title) { _title = title; } @Override public String getTags() { if (_tags == null) { return StringPool.BLANK; } else { return _tags; } } @Override public void setTags(String tags) { _tags = tags; } @Override public long getLectureseriesId() { return _lectureseriesId; } @Override public void setLectureseriesId(long lectureseriesId) { _lectureseriesId = lectureseriesId; } @Override public long getOwnerId() { return _ownerId; } @Override public void setOwnerId(long ownerId) { _ownerId = ownerId; } @Override public long getProducerId() { return _producerId; } @Override public void setProducerId(long producerId) { _producerId = producerId; } @Override public String getContainerFormat() { if (_containerFormat == null) { return StringPool.BLANK; } else { return _containerFormat; } } @Override public void setContainerFormat(String containerFormat) { _containerFormat = containerFormat; } @Override public String getFilename() { if (_filename == null) { return StringPool.BLANK; } else { return _filename; } } @Override public void setFilename(String filename) { _filename = filename; } @Override public String getResolution() { if (_resolution == null) { return StringPool.BLANK; } else { return _resolution; } } @Override public void setResolution(String resolution) { _resolution = resolution; } @Override public String getDuration() { if (_duration == null) { return StringPool.BLANK; } else { return _duration; } } @Override public void setDuration(String duration) { _duration = duration; } @Override public long getHostId() { return _hostId; } @Override public void setHostId(long hostId) { _hostId = hostId; } @Override public long getTextId() { return _textId; } @Override public void setTextId(long textId) { _textId = textId; } @Override public String getFileSize() { if (_fileSize == null) { return StringPool.BLANK; } else { return _fileSize; } } @Override public void setFileSize(String fileSize) { _fileSize = fileSize; } @Override public String getGenerationDate() { if (_generationDate == null) { return StringPool.BLANK; } else { return _generationDate; } } @Override public void setGenerationDate(String generationDate) { _generationDate = generationDate; } @Override public int getOpenAccess() { return _openAccess; } @Override public void setOpenAccess(int openAccess) { _openAccess = openAccess; } @Override public int getDownloadLink() { return _downloadLink; } @Override public void setDownloadLink(int downloadLink) { _downloadLink = downloadLink; } @Override public long getMetadataId() { return _metadataId; } @Override public void setMetadataId(long metadataId) { _metadataId = metadataId; } @Override public String getSurl() { if (_surl == null) { return StringPool.BLANK; } else { return _surl; } } @Override public void setSurl(String surl) { _surl = surl; } @Override public long getHits() { return _hits; } @Override public void setHits(long hits) { _hits = hits; } @Override public Date getUploadDate() { return _uploadDate; } @Override public void setUploadDate(Date uploadDate) { _uploadDate = uploadDate; } @Override public int getPermittedToSegment() { return _permittedToSegment; } @Override public void setPermittedToSegment(int permittedToSegment) { _permittedToSegment = permittedToSegment; } @Override public long getFacilityId() { return _facilityId; } @Override public void setFacilityId(long facilityId) { _facilityId = facilityId; } @Override public int getCitation2go() { return _citation2go; } @Override public void setCitation2go(int citation2go) { _citation2go = citation2go; } @Override public ExpandoBridge getExpandoBridge() { return ExpandoBridgeFactoryUtil.getExpandoBridge(0, LegacyVideo.class.getName(), getPrimaryKey()); } @Override public void setExpandoBridgeAttributes(ServiceContext serviceContext) { ExpandoBridge expandoBridge = getExpandoBridge(); expandoBridge.setAttributes(serviceContext); } @Override public LegacyVideo toEscapedModel() { if (_escapedModel == null) { _escapedModel = (LegacyVideo)ProxyUtil.newProxyInstance(_classLoader, _escapedModelInterfaces, new AutoEscapeBeanHandler(this)); } return _escapedModel; } @Override public Object clone() { LegacyVideoImpl legacyVideoImpl = new LegacyVideoImpl(); legacyVideoImpl.setId(getId()); legacyVideoImpl.setTitle(getTitle()); legacyVideoImpl.setTags(getTags()); legacyVideoImpl.setLectureseriesId(getLectureseriesId()); legacyVideoImpl.setOwnerId(getOwnerId()); legacyVideoImpl.setProducerId(getProducerId()); legacyVideoImpl.setContainerFormat(getContainerFormat()); legacyVideoImpl.setFilename(getFilename()); legacyVideoImpl.setResolution(getResolution()); legacyVideoImpl.setDuration(getDuration()); legacyVideoImpl.setHostId(getHostId()); legacyVideoImpl.setTextId(getTextId()); legacyVideoImpl.setFileSize(getFileSize()); legacyVideoImpl.setGenerationDate(getGenerationDate()); legacyVideoImpl.setOpenAccess(getOpenAccess()); legacyVideoImpl.setDownloadLink(getDownloadLink()); legacyVideoImpl.setMetadataId(getMetadataId()); legacyVideoImpl.setSurl(getSurl()); legacyVideoImpl.setHits(getHits()); legacyVideoImpl.setUploadDate(getUploadDate()); legacyVideoImpl.setPermittedToSegment(getPermittedToSegment()); legacyVideoImpl.setFacilityId(getFacilityId()); legacyVideoImpl.setCitation2go(getCitation2go()); legacyVideoImpl.resetOriginalValues(); return legacyVideoImpl; } @Override public int compareTo(LegacyVideo legacyVideo) { long primaryKey = legacyVideo.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 LegacyVideo)) { return false; } LegacyVideo legacyVideo = (LegacyVideo)obj; long primaryKey = legacyVideo.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } } @Override public int hashCode() { return (int)getPrimaryKey(); } @Override public void resetOriginalValues() { } @Override public CacheModel<LegacyVideo> toCacheModel() { LegacyVideoCacheModel legacyVideoCacheModel = new LegacyVideoCacheModel(); legacyVideoCacheModel.id = getId(); legacyVideoCacheModel.title = getTitle(); String title = legacyVideoCacheModel.title; if ((title != null) && (title.length() == 0)) { legacyVideoCacheModel.title = null; } legacyVideoCacheModel.tags = getTags(); String tags = legacyVideoCacheModel.tags; if ((tags != null) && (tags.length() == 0)) { legacyVideoCacheModel.tags = null; } legacyVideoCacheModel.lectureseriesId = getLectureseriesId(); legacyVideoCacheModel.ownerId = getOwnerId(); legacyVideoCacheModel.producerId = getProducerId(); legacyVideoCacheModel.containerFormat = getContainerFormat(); String containerFormat = legacyVideoCacheModel.containerFormat; if ((containerFormat != null) && (containerFormat.length() == 0)) { legacyVideoCacheModel.containerFormat = null; } legacyVideoCacheModel.filename = getFilename(); String filename = legacyVideoCacheModel.filename; if ((filename != null) && (filename.length() == 0)) { legacyVideoCacheModel.filename = null; } legacyVideoCacheModel.resolution = getResolution(); String resolution = legacyVideoCacheModel.resolution; if ((resolution != null) && (resolution.length() == 0)) { legacyVideoCacheModel.resolution = null; } legacyVideoCacheModel.duration = getDuration(); String duration = legacyVideoCacheModel.duration; if ((duration != null) && (duration.length() == 0)) { legacyVideoCacheModel.duration = null; } legacyVideoCacheModel.hostId = getHostId(); legacyVideoCacheModel.textId = getTextId(); legacyVideoCacheModel.fileSize = getFileSize(); String fileSize = legacyVideoCacheModel.fileSize; if ((fileSize != null) && (fileSize.length() == 0)) { legacyVideoCacheModel.fileSize = null; } legacyVideoCacheModel.generationDate = getGenerationDate(); String generationDate = legacyVideoCacheModel.generationDate; if ((generationDate != null) && (generationDate.length() == 0)) { legacyVideoCacheModel.generationDate = null; } legacyVideoCacheModel.openAccess = getOpenAccess(); legacyVideoCacheModel.downloadLink = getDownloadLink(); legacyVideoCacheModel.metadataId = getMetadataId(); legacyVideoCacheModel.surl = getSurl(); String surl = legacyVideoCacheModel.surl; if ((surl != null) && (surl.length() == 0)) { legacyVideoCacheModel.surl = null; } legacyVideoCacheModel.hits = getHits(); Date uploadDate = getUploadDate(); if (uploadDate != null) { legacyVideoCacheModel.uploadDate = uploadDate.getTime(); } else { legacyVideoCacheModel.uploadDate = Long.MIN_VALUE; } legacyVideoCacheModel.permittedToSegment = getPermittedToSegment(); legacyVideoCacheModel.facilityId = getFacilityId(); legacyVideoCacheModel.citation2go = getCitation2go(); return legacyVideoCacheModel; } @Override public String toString() { StringBundler sb = new StringBundler(47); sb.append("{id="); sb.append(getId()); sb.append(", title="); sb.append(getTitle()); sb.append(", tags="); sb.append(getTags()); sb.append(", lectureseriesId="); sb.append(getLectureseriesId()); sb.append(", ownerId="); sb.append(getOwnerId()); sb.append(", producerId="); sb.append(getProducerId()); sb.append(", containerFormat="); sb.append(getContainerFormat()); sb.append(", filename="); sb.append(getFilename()); sb.append(", resolution="); sb.append(getResolution()); sb.append(", duration="); sb.append(getDuration()); sb.append(", hostId="); sb.append(getHostId()); sb.append(", textId="); sb.append(getTextId()); sb.append(", fileSize="); sb.append(getFileSize()); sb.append(", generationDate="); sb.append(getGenerationDate()); sb.append(", openAccess="); sb.append(getOpenAccess()); sb.append(", downloadLink="); sb.append(getDownloadLink()); sb.append(", metadataId="); sb.append(getMetadataId()); sb.append(", surl="); sb.append(getSurl()); sb.append(", hits="); sb.append(getHits()); sb.append(", uploadDate="); sb.append(getUploadDate()); sb.append(", permittedToSegment="); sb.append(getPermittedToSegment()); sb.append(", facilityId="); sb.append(getFacilityId()); sb.append(", citation2go="); sb.append(getCitation2go()); sb.append("}"); return sb.toString(); } @Override public String toXmlString() { StringBundler sb = new StringBundler(73); sb.append("<model><model-name>"); sb.append("de.uhh.l2g.plugins.migration.model.LegacyVideo"); 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>title</column-name><column-value><![CDATA["); sb.append(getTitle()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>tags</column-name><column-value><![CDATA["); sb.append(getTags()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>lectureseriesId</column-name><column-value><![CDATA["); sb.append(getLectureseriesId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>ownerId</column-name><column-value><![CDATA["); sb.append(getOwnerId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>producerId</column-name><column-value><![CDATA["); sb.append(getProducerId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>containerFormat</column-name><column-value><![CDATA["); sb.append(getContainerFormat()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>filename</column-name><column-value><![CDATA["); sb.append(getFilename()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>resolution</column-name><column-value><![CDATA["); sb.append(getResolution()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>duration</column-name><column-value><![CDATA["); sb.append(getDuration()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>hostId</column-name><column-value><![CDATA["); sb.append(getHostId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>textId</column-name><column-value><![CDATA["); sb.append(getTextId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>fileSize</column-name><column-value><![CDATA["); sb.append(getFileSize()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>generationDate</column-name><column-value><![CDATA["); sb.append(getGenerationDate()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>openAccess</column-name><column-value><![CDATA["); sb.append(getOpenAccess()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>downloadLink</column-name><column-value><![CDATA["); sb.append(getDownloadLink()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>metadataId</column-name><column-value><![CDATA["); sb.append(getMetadataId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>surl</column-name><column-value><![CDATA["); sb.append(getSurl()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>hits</column-name><column-value><![CDATA["); sb.append(getHits()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>uploadDate</column-name><column-value><![CDATA["); sb.append(getUploadDate()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>permittedToSegment</column-name><column-value><![CDATA["); sb.append(getPermittedToSegment()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>facilityId</column-name><column-value><![CDATA["); sb.append(getFacilityId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>citation2go</column-name><column-value><![CDATA["); sb.append(getCitation2go()); sb.append("]]></column-value></column>"); sb.append("</model>"); return sb.toString(); } private static ClassLoader _classLoader = LegacyVideo.class.getClassLoader(); private static Class<?>[] _escapedModelInterfaces = new Class[] { LegacyVideo.class }; private long _id; private String _title; private String _tags; private long _lectureseriesId; private long _ownerId; private long _producerId; private String _containerFormat; private String _filename; private String _resolution; private String _duration; private long _hostId; private long _textId; private String _fileSize; private String _generationDate; private int _openAccess; private int _downloadLink; private long _metadataId; private String _surl; private long _hits; private Date _uploadDate; private int _permittedToSegment; private long _facilityId; private int _citation2go; private LegacyVideo _escapedModel; }