--- /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.pentila.entSavoie.internalMessaging.service.InternalAttachFileLocalServiceUtil;
+
+import java.io.Serializable;
+
+import java.lang.reflect.Proxy;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Igor Barma - Mathieu Amblard
+ */
+public class InternalAttachFileClp extends BaseModelImpl<InternalAttachFile>
+ implements InternalAttachFile {
+ public InternalAttachFileClp() {
+ }
+
+ public Class<?> getModelClass() {
+ return InternalAttachFile.class;
+ }
+
+ public String getModelClassName() {
+ return InternalAttachFile.class.getName();
+ }
+
+ public long getPrimaryKey() {
+ return _internalAttachFileId;
+ }
+
+ public void setPrimaryKey(long primaryKey) {
+ setInternalAttachFileId(primaryKey);
+ }
+
+ public Serializable getPrimaryKeyObj() {
+ return new Long(_internalAttachFileId);
+ }
+
+ 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("internalAttachFileId", getInternalAttachFileId());
+ attributes.put("attachFileId", getAttachFileId());
+ attributes.put("messageId", getMessageId());
+ attributes.put("attachFileType", getAttachFileType());
+
+ return attributes;
+ }
+
+ @Override
+ public void setModelAttributes(Map<String, Object> attributes) {
+ Long internalAttachFileId = (Long)attributes.get("internalAttachFileId");
+
+ if (internalAttachFileId != null) {
+ setInternalAttachFileId(internalAttachFileId);
+ }
+
+ Long attachFileId = (Long)attributes.get("attachFileId");
+
+ if (attachFileId != null) {
+ setAttachFileId(attachFileId);
+ }
+
+ Long messageId = (Long)attributes.get("messageId");
+
+ if (messageId != null) {
+ setMessageId(messageId);
+ }
+
+ String attachFileType = (String)attributes.get("attachFileType");
+
+ if (attachFileType != null) {
+ setAttachFileType(attachFileType);
+ }
+ }
+
+ public long getInternalAttachFileId() {
+ return _internalAttachFileId;
+ }
+
+ public void setInternalAttachFileId(long internalAttachFileId) {
+ _internalAttachFileId = internalAttachFileId;
+ }
+
+ public long getAttachFileId() {
+ return _attachFileId;
+ }
+
+ public void setAttachFileId(long attachFileId) {
+ _attachFileId = attachFileId;
+ }
+
+ public long getMessageId() {
+ return _messageId;
+ }
+
+ public void setMessageId(long messageId) {
+ _messageId = messageId;
+ }
+
+ public String getAttachFileType() {
+ return _attachFileType;
+ }
+
+ public void setAttachFileType(String attachFileType) {
+ _attachFileType = attachFileType;
+ }
+
+ public BaseModel<?> getInternalAttachFileRemoteModel() {
+ return _internalAttachFileRemoteModel;
+ }
+
+ public void setInternalAttachFileRemoteModel(
+ BaseModel<?> internalAttachFileRemoteModel) {
+ _internalAttachFileRemoteModel = internalAttachFileRemoteModel;
+ }
+
+ public void persist() throws SystemException {
+ if (this.isNew()) {
+ InternalAttachFileLocalServiceUtil.addInternalAttachFile(this);
+ }
+ else {
+ InternalAttachFileLocalServiceUtil.updateInternalAttachFile(this);
+ }
+ }
+
+ @Override
+ public InternalAttachFile toEscapedModel() {
+ return (InternalAttachFile)Proxy.newProxyInstance(InternalAttachFile.class.getClassLoader(),
+ new Class[] { InternalAttachFile.class },
+ new AutoEscapeBeanHandler(this));
+ }
+
+ @Override
+ public Object clone() {
+ InternalAttachFileClp clone = new InternalAttachFileClp();
+
+ clone.setInternalAttachFileId(getInternalAttachFileId());
+ clone.setAttachFileId(getAttachFileId());
+ clone.setMessageId(getMessageId());
+ clone.setAttachFileType(getAttachFileType());
+
+ return clone;
+ }
+
+ public int compareTo(InternalAttachFile internalAttachFile) {
+ long primaryKey = internalAttachFile.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;
+ }
+
+ InternalAttachFileClp internalAttachFile = null;
+
+ try {
+ internalAttachFile = (InternalAttachFileClp)obj;
+ }
+ catch (ClassCastException cce) {
+ return false;
+ }
+
+ long primaryKey = internalAttachFile.getPrimaryKey();
+
+ if (getPrimaryKey() == primaryKey) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return (int)getPrimaryKey();
+ }
+
+ @Override
+ public String toString() {
+ StringBundler sb = new StringBundler(9);
+
+ sb.append("{internalAttachFileId=");
+ sb.append(getInternalAttachFileId());
+ sb.append(", attachFileId=");
+ sb.append(getAttachFileId());
+ sb.append(", messageId=");
+ sb.append(getMessageId());
+ sb.append(", attachFileType=");
+ sb.append(getAttachFileType());
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ public String toXmlString() {
+ StringBundler sb = new StringBundler(16);
+
+ sb.append("<model><model-name>");
+ sb.append(
+ "com.pentila.entSavoie.internalMessaging.model.InternalAttachFile");
+ sb.append("</model-name>");
+
+ sb.append(
+ "<column><column-name>internalAttachFileId</column-name><column-value><![CDATA[");
+ sb.append(getInternalAttachFileId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>attachFileId</column-name><column-value><![CDATA[");
+ sb.append(getAttachFileId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>messageId</column-name><column-value><![CDATA[");
+ sb.append(getMessageId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>attachFileType</column-name><column-value><![CDATA[");
+ sb.append(getAttachFileType());
+ sb.append("]]></column-value></column>");
+
+ sb.append("</model>");
+
+ return sb.toString();
+ }
+
+ private long _internalAttachFileId;
+ private long _attachFileId;
+ private long _messageId;
+ private String _attachFileType;
+ private BaseModel<?> _internalAttachFileRemoteModel;
+}
\ No newline at end of file