/** * 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.ese.ils.beta.model; import com.ese.ils.beta.service.SlideLocalServiceUtil; 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 java.io.Serializable; import java.lang.reflect.Proxy; import java.util.Date; import java.util.HashMap; import java.util.Map; /** * @author edik */ public class SlideClp extends BaseModelImpl<Slide> implements Slide { public SlideClp() { } public Class<?> getModelClass() { return Slide.class; } public String getModelClassName() { return Slide.class.getName(); } public long getPrimaryKey() { return _slideId; } public void setPrimaryKey(long primaryKey) { setSlideId(primaryKey); } public Serializable getPrimaryKeyObj() { return new Long(_slideId); } 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("slideId", getSlideId()); attributes.put("createDate", getCreateDate()); attributes.put("modifiedDate", getModifiedDate()); attributes.put("fileEntryId", getFileEntryId()); attributes.put("moduleId", getModuleId()); attributes.put("addtionalInfo", getAddtionalInfo()); attributes.put("index", getIndex()); return attributes; } @Override public void setModelAttributes(Map<String, Object> attributes) { Long slideId = (Long)attributes.get("slideId"); if (slideId != null) { setSlideId(slideId); } Date createDate = (Date)attributes.get("createDate"); if (createDate != null) { setCreateDate(createDate); } Date modifiedDate = (Date)attributes.get("modifiedDate"); if (modifiedDate != null) { setModifiedDate(modifiedDate); } Long fileEntryId = (Long)attributes.get("fileEntryId"); if (fileEntryId != null) { setFileEntryId(fileEntryId); } Long moduleId = (Long)attributes.get("moduleId"); if (moduleId != null) { setModuleId(moduleId); } String addtionalInfo = (String)attributes.get("addtionalInfo"); if (addtionalInfo != null) { setAddtionalInfo(addtionalInfo); } Integer index = (Integer)attributes.get("index"); if (index != null) { setIndex(index); } } public long getSlideId() { return _slideId; } public void setSlideId(long slideId) { _slideId = slideId; } public Date getCreateDate() { return _createDate; } public void setCreateDate(Date createDate) { _createDate = createDate; } public Date getModifiedDate() { return _modifiedDate; } public void setModifiedDate(Date modifiedDate) { _modifiedDate = modifiedDate; } public long getFileEntryId() { return _fileEntryId; } public void setFileEntryId(long fileEntryId) { _fileEntryId = fileEntryId; } public long getModuleId() { return _moduleId; } public void setModuleId(long moduleId) { _moduleId = moduleId; } public String getAddtionalInfo() { return _addtionalInfo; } public void setAddtionalInfo(String addtionalInfo) { _addtionalInfo = addtionalInfo; } public int getIndex() { return _index; } public void setIndex(int index) { _index = index; } public BaseModel<?> getSlideRemoteModel() { return _slideRemoteModel; } public void setSlideRemoteModel(BaseModel<?> slideRemoteModel) { _slideRemoteModel = slideRemoteModel; } public void persist() throws SystemException { if (this.isNew()) { SlideLocalServiceUtil.addSlide(this); } else { SlideLocalServiceUtil.updateSlide(this); } } @Override public Slide toEscapedModel() { return (Slide)Proxy.newProxyInstance(Slide.class.getClassLoader(), new Class[] { Slide.class }, new AutoEscapeBeanHandler(this)); } @Override public Object clone() { SlideClp clone = new SlideClp(); clone.setSlideId(getSlideId()); clone.setCreateDate(getCreateDate()); clone.setModifiedDate(getModifiedDate()); clone.setFileEntryId(getFileEntryId()); clone.setModuleId(getModuleId()); clone.setAddtionalInfo(getAddtionalInfo()); clone.setIndex(getIndex()); return clone; } public int compareTo(Slide slide) { int value = 0; if (getSlideId() < slide.getSlideId()) { value = -1; } else if (getSlideId() > slide.getSlideId()) { value = 1; } else { value = 0; } if (value != 0) { return value; } return 0; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } SlideClp slide = null; try { slide = (SlideClp)obj; } catch (ClassCastException cce) { return false; } long primaryKey = slide.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } } @Override public int hashCode() { return (int)getPrimaryKey(); } @Override public String toString() { StringBundler sb = new StringBundler(15); sb.append("{slideId="); sb.append(getSlideId()); sb.append(", createDate="); sb.append(getCreateDate()); sb.append(", modifiedDate="); sb.append(getModifiedDate()); sb.append(", fileEntryId="); sb.append(getFileEntryId()); sb.append(", moduleId="); sb.append(getModuleId()); sb.append(", addtionalInfo="); sb.append(getAddtionalInfo()); sb.append(", index="); sb.append(getIndex()); sb.append("}"); return sb.toString(); } public String toXmlString() { StringBundler sb = new StringBundler(25); sb.append("<model><model-name>"); sb.append("com.ese.ils.beta.model.Slide"); sb.append("</model-name>"); sb.append( "<column><column-name>slideId</column-name><column-value><![CDATA["); sb.append(getSlideId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>createDate</column-name><column-value><![CDATA["); sb.append(getCreateDate()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>modifiedDate</column-name><column-value><![CDATA["); sb.append(getModifiedDate()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>fileEntryId</column-name><column-value><![CDATA["); sb.append(getFileEntryId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>moduleId</column-name><column-value><![CDATA["); sb.append(getModuleId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>addtionalInfo</column-name><column-value><![CDATA["); sb.append(getAddtionalInfo()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>index</column-name><column-value><![CDATA["); sb.append(getIndex()); sb.append("]]></column-value></column>"); sb.append("</model>"); return sb.toString(); } private long _slideId; private Date _createDate; private Date _modifiedDate; private long _fileEntryId; private long _moduleId; private String _addtionalInfo; private int _index; private BaseModel<?> _slideRemoteModel; }