--- /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.gestionServiceURL.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.gestionServiceURL.service.ServiceURLLocalServiceUtil;
+
+import java.io.Serializable;
+
+import java.lang.reflect.Proxy;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Barma Igor - AMBLARD Mathieu
+ */
+public class ServiceURLClp extends BaseModelImpl<ServiceURL>
+ implements ServiceURL {
+ public ServiceURLClp() {
+ }
+
+ public Class<?> getModelClass() {
+ return ServiceURL.class;
+ }
+
+ public String getModelClassName() {
+ return ServiceURL.class.getName();
+ }
+
+ public long getPrimaryKey() {
+ return _serviceURLId;
+ }
+
+ public void setPrimaryKey(long primaryKey) {
+ setServiceURLId(primaryKey);
+ }
+
+ public Serializable getPrimaryKeyObj() {
+ return new Long(_serviceURLId);
+ }
+
+ 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("serviceURLId", getServiceURLId());
+ attributes.put("etabId", getEtabId());
+ attributes.put("serviceURL", getServiceURL());
+ attributes.put("serviceType", getServiceType());
+
+ return attributes;
+ }
+
+ @Override
+ public void setModelAttributes(Map<String, Object> attributes) {
+ Long serviceURLId = (Long)attributes.get("serviceURLId");
+
+ if (serviceURLId != null) {
+ setServiceURLId(serviceURLId);
+ }
+
+ Long etabId = (Long)attributes.get("etabId");
+
+ if (etabId != null) {
+ setEtabId(etabId);
+ }
+
+ String serviceURL = (String)attributes.get("serviceURL");
+
+ if (serviceURL != null) {
+ setServiceURL(serviceURL);
+ }
+
+ String serviceType = (String)attributes.get("serviceType");
+
+ if (serviceType != null) {
+ setServiceType(serviceType);
+ }
+ }
+
+ public long getServiceURLId() {
+ return _serviceURLId;
+ }
+
+ public void setServiceURLId(long serviceURLId) {
+ _serviceURLId = serviceURLId;
+ }
+
+ public long getEtabId() {
+ return _etabId;
+ }
+
+ public void setEtabId(long etabId) {
+ _etabId = etabId;
+ }
+
+ public String getServiceURL() {
+ return _serviceURL;
+ }
+
+ public void setServiceURL(String serviceURL) {
+ _serviceURL = serviceURL;
+ }
+
+ public String getServiceType() {
+ return _serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ _serviceType = serviceType;
+ }
+
+ public BaseModel<?> getServiceURLRemoteModel() {
+ return _serviceURLRemoteModel;
+ }
+
+ public void setServiceURLRemoteModel(BaseModel<?> serviceURLRemoteModel) {
+ _serviceURLRemoteModel = serviceURLRemoteModel;
+ }
+
+ public void persist() throws SystemException {
+ if (this.isNew()) {
+ ServiceURLLocalServiceUtil.addServiceURL(this);
+ }
+ else {
+ ServiceURLLocalServiceUtil.updateServiceURL(this);
+ }
+ }
+
+ @Override
+ public ServiceURL toEscapedModel() {
+ return (ServiceURL)Proxy.newProxyInstance(ServiceURL.class.getClassLoader(),
+ new Class[] { ServiceURL.class }, new AutoEscapeBeanHandler(this));
+ }
+
+ @Override
+ public Object clone() {
+ ServiceURLClp clone = new ServiceURLClp();
+
+ clone.setServiceURLId(getServiceURLId());
+ clone.setEtabId(getEtabId());
+ clone.setServiceURL(getServiceURL());
+ clone.setServiceType(getServiceType());
+
+ return clone;
+ }
+
+ public int compareTo(ServiceURL serviceURL) {
+ long primaryKey = serviceURL.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;
+ }
+
+ ServiceURLClp serviceURL = null;
+
+ try {
+ serviceURL = (ServiceURLClp)obj;
+ }
+ catch (ClassCastException cce) {
+ return false;
+ }
+
+ long primaryKey = serviceURL.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("{serviceURLId=");
+ sb.append(getServiceURLId());
+ sb.append(", etabId=");
+ sb.append(getEtabId());
+ sb.append(", serviceURL=");
+ sb.append(getServiceURL());
+ sb.append(", serviceType=");
+ sb.append(getServiceType());
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ public String toXmlString() {
+ StringBundler sb = new StringBundler(16);
+
+ sb.append("<model><model-name>");
+ sb.append("com.pentila.entSavoie.gestionServiceURL.model.ServiceURL");
+ sb.append("</model-name>");
+
+ sb.append(
+ "<column><column-name>serviceURLId</column-name><column-value><![CDATA[");
+ sb.append(getServiceURLId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>etabId</column-name><column-value><![CDATA[");
+ sb.append(getEtabId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>serviceURL</column-name><column-value><![CDATA[");
+ sb.append(getServiceURL());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>serviceType</column-name><column-value><![CDATA[");
+ sb.append(getServiceType());
+ sb.append("]]></column-value></column>");
+
+ sb.append("</model>");
+
+ return sb.toString();
+ }
+
+ private long _serviceURLId;
+ private long _etabId;
+ private String _serviceURL;
+ private String _serviceType;
+ private BaseModel<?> _serviceURLRemoteModel;
+}
\ No newline at end of file