--- /dev/null
+/*******************************************************************************
+ * Copyright © Igor Barma, Alexandre Desoubeaux, Christian Martel, Eric Brun, Mathieu Amblard, Gwenael Gevet, Pierre Guillot, 2012
+ *
+ * This file is part of the work and learning management system Pentila Nero.
+ *
+ * Pentila Nero is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ * - the GNU Lesser General Public License as published by the
+ * Free Software Foundation, either version 3 of the license,
+ * or (at your option) any later version.
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE-PROJECT.txt in the directory of this software
+ * distribution.
+ *
+ * Pentila Nero 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
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * and the CeCILL-C and the GNU Lesser General Public License along with
+ * Pentila Nero. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ ******************************************************************************/
+package com.pentila.entSavoie.amis.model.impl;
+
+import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
+import com.liferay.portal.kernel.util.GetterUtil;
+import com.liferay.portal.kernel.util.HtmlUtil;
+import com.liferay.portal.model.impl.BaseModelImpl;
+
+import com.liferay.portlet.expando.model.ExpandoBridge;
+import com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl;
+
+import com.pentila.entSavoie.amis.model.Relationship;
+import com.pentila.entSavoie.amis.model.RelationshipSoap;
+
+import java.io.Serializable;
+
+import java.lang.reflect.Proxy;
+
+import java.sql.Types;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * <a href="RelationshipModelImpl.java.html"><b><i>View Source</i></b></a>
+ *
+ * <p>
+ * ServiceBuilder generated this class. Modifications in this class will be
+ * overwritten the next time is generated.
+ * </p>
+ *
+ * <p>
+ * This class is a model that represents the <code>Relationship</code> table
+ * in the database.
+ * </p>
+ *
+ * @author Brian Wing Shun Chan
+ *
+ * @see com.pentila.entSavoie.amis.model.Relationship
+ * @see com.pentila.entSavoie.amis.model.RelationshipModel
+ * @see com.pentila.entSavoie.amis.model.impl.RelationshipImpl
+ *
+ */
+public class RelationshipModelImpl extends BaseModelImpl<Relationship> {
+ public static final String TABLE_NAME = "Relationship";
+ public static final Object[][] TABLE_COLUMNS = {
+ { "relationId", new Integer(Types.BIGINT) },
+
+
+ { "userId", new Integer(Types.BIGINT) },
+
+
+ { "friendId", new Integer(Types.BIGINT) },
+
+
+ { "stateId", new Integer(Types.INTEGER) },
+
+
+ { "friendFolderId", new Integer(Types.BIGINT) },
+
+
+ { "message", new Integer(Types.VARCHAR) }
+ };
+ public static final String TABLE_SQL_CREATE = "create table Relationship (relationId LONG not null primary key,userId LONG,friendId LONG,stateId INTEGER,friendFolderId LONG,message VARCHAR(75) null)";
+ public static final String TABLE_SQL_DROP = "drop table Relationship";
+ public static final String DATA_SOURCE = "liferayDataSource";
+ public static final String SESSION_FACTORY = "liferaySessionFactory";
+ public static final String TX_MANAGER = "liferayTransactionManager";
+ public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
+ "value.object.entity.cache.enabled.com.pentila.entSavoie.amis.model.Relationship"),
+ true);
+ public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
+ "value.object.finder.cache.enabled.com.pentila.entSavoie.amis.model.Relationship"),
+ true);
+ public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
+ "lock.expiration.time.com.pentila.entSavoie.amis.model.Relationship"));
+ private long _relationId;
+ private long _userId;
+ private long _friendId;
+ private int _stateId;
+ private long _friendFolderId;
+ private String _message;
+ private transient ExpandoBridge _expandoBridge;
+
+ public RelationshipModelImpl() {
+ }
+
+ public static Relationship toModel(RelationshipSoap soapModel) {
+ Relationship model = new RelationshipImpl();
+
+ model.setRelationId(soapModel.getRelationId());
+ model.setUserId(soapModel.getUserId());
+ model.setFriendId(soapModel.getFriendId());
+ model.setStateId(soapModel.getStateId());
+ model.setFriendFolderId(soapModel.getFriendFolderId());
+ model.setMessage(soapModel.getMessage());
+
+ return model;
+ }
+
+ public static List<Relationship> toModels(RelationshipSoap[] soapModels) {
+ List<Relationship> models = new ArrayList<Relationship>(soapModels.length);
+
+ for (RelationshipSoap soapModel : soapModels) {
+ models.add(toModel(soapModel));
+ }
+
+ return models;
+ }
+
+ public long getPrimaryKey() {
+ return _relationId;
+ }
+
+ public void setPrimaryKey(long pk) {
+ setRelationId(pk);
+ }
+
+ public Serializable getPrimaryKeyObj() {
+ return new Long(_relationId);
+ }
+
+ public long getRelationId() {
+ return _relationId;
+ }
+
+ public void setRelationId(long relationId) {
+ _relationId = relationId;
+ }
+
+ public long getUserId() {
+ return _userId;
+ }
+
+ public void setUserId(long userId) {
+ _userId = userId;
+ }
+
+ public long getFriendId() {
+ return _friendId;
+ }
+
+ public void setFriendId(long friendId) {
+ _friendId = friendId;
+ }
+
+ public int getStateId() {
+ return _stateId;
+ }
+
+ public void setStateId(int stateId) {
+ _stateId = stateId;
+ }
+
+ public long getFriendFolderId() {
+ return _friendFolderId;
+ }
+
+ public void setFriendFolderId(long friendFolderId) {
+ _friendFolderId = friendFolderId;
+ }
+
+ public String getMessage() {
+ return GetterUtil.getString(_message);
+ }
+
+ public void setMessage(String message) {
+ _message = message;
+ }
+
+ public Relationship toEscapedModel() {
+ if (isEscapedModel()) {
+ return (Relationship) this;
+ } else {
+ Relationship model = new RelationshipImpl();
+
+ model.setNew(isNew());
+ model.setEscapedModel(true);
+
+ model.setRelationId(getRelationId());
+ model.setUserId(getUserId());
+ model.setFriendId(getFriendId());
+ model.setStateId(getStateId());
+ model.setFriendFolderId(getFriendFolderId());
+ model.setMessage(HtmlUtil.escape(getMessage()));
+
+ model = (Relationship) Proxy.newProxyInstance(Relationship.class.getClassLoader(),
+ new Class[] { Relationship.class },
+ new ReadOnlyBeanHandler(model));
+
+ return model;
+ }
+ }
+
+ public ExpandoBridge getExpandoBridge() {
+ if (_expandoBridge == null) {
+ _expandoBridge = new ExpandoBridgeImpl(Relationship.class.getName(),
+ getPrimaryKey());
+ }
+
+ return _expandoBridge;
+ }
+
+ public Object clone() {
+ RelationshipImpl clone = new RelationshipImpl();
+
+ clone.setRelationId(getRelationId());
+ clone.setUserId(getUserId());
+ clone.setFriendId(getFriendId());
+ clone.setStateId(getStateId());
+ clone.setFriendFolderId(getFriendFolderId());
+ clone.setMessage(getMessage());
+
+ return clone;
+ }
+
+ public int compareTo(Relationship relationship) {
+ long pk = relationship.getPrimaryKey();
+
+ if (getPrimaryKey() < pk) {
+ return -1;
+ } else if (getPrimaryKey() > pk) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+
+ Relationship relationship = null;
+
+ try {
+ relationship = (Relationship) obj;
+ } catch (ClassCastException cce) {
+ return false;
+ }
+
+ long pk = relationship.getPrimaryKey();
+
+ if (getPrimaryKey() == pk) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public int hashCode() {
+ return (int) getPrimaryKey();
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append("{relationId=");
+ sb.append(getRelationId());
+ sb.append(", userId=");
+ sb.append(getUserId());
+ sb.append(", friendId=");
+ sb.append(getFriendId());
+ sb.append(", stateId=");
+ sb.append(getStateId());
+ sb.append(", friendFolderId=");
+ sb.append(getFriendFolderId());
+ sb.append(", message=");
+ sb.append(getMessage());
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ public String toXmlString() {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append("<model><model-name>");
+ sb.append("com.pentila.entSavoie.amis.model.Relationship");
+ sb.append("</model-name>");
+
+ sb.append(
+ "<column><column-name>relationId</column-name><column-value><![CDATA[");
+ sb.append(getRelationId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>userId</column-name><column-value><![CDATA[");
+ sb.append(getUserId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>friendId</column-name><column-value><![CDATA[");
+ sb.append(getFriendId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>stateId</column-name><column-value><![CDATA[");
+ sb.append(getStateId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>friendFolderId</column-name><column-value><![CDATA[");
+ sb.append(getFriendFolderId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>message</column-name><column-value><![CDATA[");
+ sb.append(getMessage());
+ sb.append("]]></column-value></column>");
+
+ sb.append("</model>");
+
+ return sb.toString();
+ }
+}