--- /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.gestionMenus.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.gestionMenus.service.EntityMenuLocalServiceUtil;
+
+import java.io.Serializable;
+
+import java.lang.reflect.Proxy;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author DIMIER Cedric et TARDY Camille
+ */
+public class EntityMenuClp extends BaseModelImpl<EntityMenu>
+ implements EntityMenu {
+ public EntityMenuClp() {
+ }
+
+ public Class<?> getModelClass() {
+ return EntityMenu.class;
+ }
+
+ public String getModelClassName() {
+ return EntityMenu.class.getName();
+ }
+
+ public long getPrimaryKey() {
+ return _entityId;
+ }
+
+ public void setPrimaryKey(long primaryKey) {
+ setEntityId(primaryKey);
+ }
+
+ public Serializable getPrimaryKeyObj() {
+ return new Long(_entityId);
+ }
+
+ 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("entityId", getEntityId());
+ attributes.put("etabId", getEtabId());
+ attributes.put("entityName", getEntityName());
+ attributes.put("appRoleId", getAppRoleId());
+ attributes.put("nodePath", getNodePath());
+ attributes.put("isLeaf", getIsLeaf());
+ attributes.put("orderEntity", getOrderEntity());
+ attributes.put("styleEntity", getStyleEntity());
+ attributes.put("imageId", getImageId());
+ attributes.put("category", getCategory());
+ attributes.put("orderEntityFullScreen", getOrderEntityFullScreen());
+ attributes.put("defaultIconClass", getDefaultIconClass());
+
+ return attributes;
+ }
+
+ @Override
+ public void setModelAttributes(Map<String, Object> attributes) {
+ Long entityId = (Long)attributes.get("entityId");
+
+ if (entityId != null) {
+ setEntityId(entityId);
+ }
+
+ Long etabId = (Long)attributes.get("etabId");
+
+ if (etabId != null) {
+ setEtabId(etabId);
+ }
+
+ String entityName = (String)attributes.get("entityName");
+
+ if (entityName != null) {
+ setEntityName(entityName);
+ }
+
+ Long appRoleId = (Long)attributes.get("appRoleId");
+
+ if (appRoleId != null) {
+ setAppRoleId(appRoleId);
+ }
+
+ String nodePath = (String)attributes.get("nodePath");
+
+ if (nodePath != null) {
+ setNodePath(nodePath);
+ }
+
+ Boolean isLeaf = (Boolean)attributes.get("isLeaf");
+
+ if (isLeaf != null) {
+ setIsLeaf(isLeaf);
+ }
+
+ Integer orderEntity = (Integer)attributes.get("orderEntity");
+
+ if (orderEntity != null) {
+ setOrderEntity(orderEntity);
+ }
+
+ String styleEntity = (String)attributes.get("styleEntity");
+
+ if (styleEntity != null) {
+ setStyleEntity(styleEntity);
+ }
+
+ Long imageId = (Long)attributes.get("imageId");
+
+ if (imageId != null) {
+ setImageId(imageId);
+ }
+
+ String category = (String)attributes.get("category");
+
+ if (category != null) {
+ setCategory(category);
+ }
+
+ Integer orderEntityFullScreen = (Integer)attributes.get(
+ "orderEntityFullScreen");
+
+ if (orderEntityFullScreen != null) {
+ setOrderEntityFullScreen(orderEntityFullScreen);
+ }
+
+ String defaultIconClass = (String)attributes.get("defaultIconClass");
+
+ if (defaultIconClass != null) {
+ setDefaultIconClass(defaultIconClass);
+ }
+ }
+
+ public long getEntityId() {
+ return _entityId;
+ }
+
+ public void setEntityId(long entityId) {
+ _entityId = entityId;
+ }
+
+ public long getEtabId() {
+ return _etabId;
+ }
+
+ public void setEtabId(long etabId) {
+ _etabId = etabId;
+ }
+
+ public String getEntityName() {
+ return _entityName;
+ }
+
+ public void setEntityName(String entityName) {
+ _entityName = entityName;
+ }
+
+ public long getAppRoleId() {
+ return _appRoleId;
+ }
+
+ public void setAppRoleId(long appRoleId) {
+ _appRoleId = appRoleId;
+ }
+
+ public String getNodePath() {
+ return _nodePath;
+ }
+
+ public void setNodePath(String nodePath) {
+ _nodePath = nodePath;
+ }
+
+ public boolean getIsLeaf() {
+ return _isLeaf;
+ }
+
+ public boolean isIsLeaf() {
+ return _isLeaf;
+ }
+
+ public void setIsLeaf(boolean isLeaf) {
+ _isLeaf = isLeaf;
+ }
+
+ public int getOrderEntity() {
+ return _orderEntity;
+ }
+
+ public void setOrderEntity(int orderEntity) {
+ _orderEntity = orderEntity;
+ }
+
+ public String getStyleEntity() {
+ return _styleEntity;
+ }
+
+ public void setStyleEntity(String styleEntity) {
+ _styleEntity = styleEntity;
+ }
+
+ public long getImageId() {
+ return _imageId;
+ }
+
+ public void setImageId(long imageId) {
+ _imageId = imageId;
+ }
+
+ public String getCategory() {
+ return _category;
+ }
+
+ public void setCategory(String category) {
+ _category = category;
+ }
+
+ public int getOrderEntityFullScreen() {
+ return _orderEntityFullScreen;
+ }
+
+ public void setOrderEntityFullScreen(int orderEntityFullScreen) {
+ _orderEntityFullScreen = orderEntityFullScreen;
+ }
+
+ public String getDefaultIconClass() {
+ return _defaultIconClass;
+ }
+
+ public void setDefaultIconClass(String defaultIconClass) {
+ _defaultIconClass = defaultIconClass;
+ }
+
+ public BaseModel<?> getEntityMenuRemoteModel() {
+ return _entityMenuRemoteModel;
+ }
+
+ public void setEntityMenuRemoteModel(BaseModel<?> entityMenuRemoteModel) {
+ _entityMenuRemoteModel = entityMenuRemoteModel;
+ }
+
+ public void persist() throws SystemException {
+ if (this.isNew()) {
+ EntityMenuLocalServiceUtil.addEntityMenu(this);
+ }
+ else {
+ EntityMenuLocalServiceUtil.updateEntityMenu(this);
+ }
+ }
+
+ @Override
+ public EntityMenu toEscapedModel() {
+ return (EntityMenu)Proxy.newProxyInstance(EntityMenu.class.getClassLoader(),
+ new Class[] { EntityMenu.class }, new AutoEscapeBeanHandler(this));
+ }
+
+ @Override
+ public Object clone() {
+ EntityMenuClp clone = new EntityMenuClp();
+
+ clone.setEntityId(getEntityId());
+ clone.setEtabId(getEtabId());
+ clone.setEntityName(getEntityName());
+ clone.setAppRoleId(getAppRoleId());
+ clone.setNodePath(getNodePath());
+ clone.setIsLeaf(getIsLeaf());
+ clone.setOrderEntity(getOrderEntity());
+ clone.setStyleEntity(getStyleEntity());
+ clone.setImageId(getImageId());
+ clone.setCategory(getCategory());
+ clone.setOrderEntityFullScreen(getOrderEntityFullScreen());
+ clone.setDefaultIconClass(getDefaultIconClass());
+
+ return clone;
+ }
+
+ public int compareTo(EntityMenu entityMenu) {
+ int value = 0;
+
+ if (getOrderEntity() < entityMenu.getOrderEntity()) {
+ value = -1;
+ }
+ else if (getOrderEntity() > entityMenu.getOrderEntity()) {
+ value = 1;
+ }
+ else {
+ value = 0;
+ }
+
+ if (value != 0) {
+ return value;
+ }
+
+ return 0;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+
+ EntityMenuClp entityMenu = null;
+
+ try {
+ entityMenu = (EntityMenuClp)obj;
+ }
+ catch (ClassCastException cce) {
+ return false;
+ }
+
+ long primaryKey = entityMenu.getPrimaryKey();
+
+ if (getPrimaryKey() == primaryKey) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return (int)getPrimaryKey();
+ }
+
+ @Override
+ public String toString() {
+ StringBundler sb = new StringBundler(25);
+
+ sb.append("{entityId=");
+ sb.append(getEntityId());
+ sb.append(", etabId=");
+ sb.append(getEtabId());
+ sb.append(", entityName=");
+ sb.append(getEntityName());
+ sb.append(", appRoleId=");
+ sb.append(getAppRoleId());
+ sb.append(", nodePath=");
+ sb.append(getNodePath());
+ sb.append(", isLeaf=");
+ sb.append(getIsLeaf());
+ sb.append(", orderEntity=");
+ sb.append(getOrderEntity());
+ sb.append(", styleEntity=");
+ sb.append(getStyleEntity());
+ sb.append(", imageId=");
+ sb.append(getImageId());
+ sb.append(", category=");
+ sb.append(getCategory());
+ sb.append(", orderEntityFullScreen=");
+ sb.append(getOrderEntityFullScreen());
+ sb.append(", defaultIconClass=");
+ sb.append(getDefaultIconClass());
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ public String toXmlString() {
+ StringBundler sb = new StringBundler(40);
+
+ sb.append("<model><model-name>");
+ sb.append("com.pentila.entSavoie.gestionMenus.model.EntityMenu");
+ sb.append("</model-name>");
+
+ sb.append(
+ "<column><column-name>entityId</column-name><column-value><![CDATA[");
+ sb.append(getEntityId());
+ 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>entityName</column-name><column-value><![CDATA[");
+ sb.append(getEntityName());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>appRoleId</column-name><column-value><![CDATA[");
+ sb.append(getAppRoleId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>nodePath</column-name><column-value><![CDATA[");
+ sb.append(getNodePath());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>isLeaf</column-name><column-value><![CDATA[");
+ sb.append(getIsLeaf());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>orderEntity</column-name><column-value><![CDATA[");
+ sb.append(getOrderEntity());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>styleEntity</column-name><column-value><![CDATA[");
+ sb.append(getStyleEntity());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>imageId</column-name><column-value><![CDATA[");
+ sb.append(getImageId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>category</column-name><column-value><![CDATA[");
+ sb.append(getCategory());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>orderEntityFullScreen</column-name><column-value><![CDATA[");
+ sb.append(getOrderEntityFullScreen());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>defaultIconClass</column-name><column-value><![CDATA[");
+ sb.append(getDefaultIconClass());
+ sb.append("]]></column-value></column>");
+
+ sb.append("</model>");
+
+ return sb.toString();
+ }
+
+ private long _entityId;
+ private long _etabId;
+ private String _entityName;
+ private long _appRoleId;
+ private String _nodePath;
+ private boolean _isLeaf;
+ private int _orderEntity;
+ private String _styleEntity;
+ private long _imageId;
+ private String _category;
+ private int _orderEntityFullScreen;
+ private String _defaultIconClass;
+ private BaseModel<?> _entityMenuRemoteModel;
+}
\ No newline at end of file