--- /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.userProperties.model.impl;
+
+import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
+import com.liferay.portal.kernel.exception.SystemException;
+import com.liferay.portal.kernel.util.GetterUtil;
+import com.liferay.portal.kernel.util.ProxyUtil;
+import com.liferay.portal.kernel.util.StringBundler;
+import com.liferay.portal.model.CacheModel;
+import com.liferay.portal.model.impl.BaseModelImpl;
+import com.liferay.portal.service.ServiceContext;
+import com.liferay.portal.util.PortalUtil;
+
+import com.liferay.portlet.expando.model.ExpandoBridge;
+import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
+
+import com.pentila.entSavoie.userProperties.model.UserMatching;
+import com.pentila.entSavoie.userProperties.model.UserMatchingModel;
+
+import java.io.Serializable;
+
+import java.sql.Types;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The base model implementation for the UserMatching service. Represents a row in the "userProperties_UserMatching" database table, with each column mapped to a property of this class.
+ *
+ * <p>
+ * This implementation and its corresponding interface {@link com.pentila.entSavoie.userProperties.model.UserMatchingModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link UserMatchingImpl}.
+ * </p>
+ *
+ * @author Amblard Mathieu - Barma Igor
+ * @see UserMatchingImpl
+ * @see com.pentila.entSavoie.userProperties.model.UserMatching
+ * @see com.pentila.entSavoie.userProperties.model.UserMatchingModel
+ * @generated
+ */
+public class UserMatchingModelImpl extends BaseModelImpl<UserMatching>
+ implements UserMatchingModel {
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. All methods that expect a user matching model instance should use the {@link com.pentila.entSavoie.userProperties.model.UserMatching} interface instead.
+ */
+ public static final String TABLE_NAME = "userProperties_UserMatching";
+ public static final Object[][] TABLE_COLUMNS = {
+ { "userMatchingId", Types.BIGINT },
+ { "userId", Types.BIGINT },
+ { "withUserId", Types.BIGINT },
+ { "valid", Types.BOOLEAN }
+ };
+ public static final String TABLE_SQL_CREATE = "create table userProperties_UserMatching (userMatchingId LONG not null primary key,userId LONG,withUserId LONG,valid BOOLEAN)";
+ public static final String TABLE_SQL_DROP = "drop table userProperties_UserMatching";
+ 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.util.service.ServiceProps.get(
+ "value.object.entity.cache.enabled.com.pentila.entSavoie.userProperties.model.UserMatching"),
+ true);
+ public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
+ "value.object.finder.cache.enabled.com.pentila.entSavoie.userProperties.model.UserMatching"),
+ true);
+ public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
+ "value.object.column.bitmask.enabled.com.pentila.entSavoie.userProperties.model.UserMatching"),
+ true);
+ public static long USERID_COLUMN_BITMASK = 1L;
+ public static long VALID_COLUMN_BITMASK = 2L;
+ public static long WITHUSERID_COLUMN_BITMASK = 4L;
+ public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
+ "lock.expiration.time.com.pentila.entSavoie.userProperties.model.UserMatching"));
+
+ public UserMatchingModelImpl() {
+ }
+
+ public long getPrimaryKey() {
+ return _userMatchingId;
+ }
+
+ public void setPrimaryKey(long primaryKey) {
+ setUserMatchingId(primaryKey);
+ }
+
+ public Serializable getPrimaryKeyObj() {
+ return new Long(_userMatchingId);
+ }
+
+ public void setPrimaryKeyObj(Serializable primaryKeyObj) {
+ setPrimaryKey(((Long)primaryKeyObj).longValue());
+ }
+
+ public Class<?> getModelClass() {
+ return UserMatching.class;
+ }
+
+ public String getModelClassName() {
+ return UserMatching.class.getName();
+ }
+
+ @Override
+ public Map<String, Object> getModelAttributes() {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+
+ attributes.put("userMatchingId", getUserMatchingId());
+ attributes.put("userId", getUserId());
+ attributes.put("withUserId", getWithUserId());
+ attributes.put("valid", getValid());
+
+ return attributes;
+ }
+
+ @Override
+ public void setModelAttributes(Map<String, Object> attributes) {
+ Long userMatchingId = (Long)attributes.get("userMatchingId");
+
+ if (userMatchingId != null) {
+ setUserMatchingId(userMatchingId);
+ }
+
+ Long userId = (Long)attributes.get("userId");
+
+ if (userId != null) {
+ setUserId(userId);
+ }
+
+ Long withUserId = (Long)attributes.get("withUserId");
+
+ if (withUserId != null) {
+ setWithUserId(withUserId);
+ }
+
+ Boolean valid = (Boolean)attributes.get("valid");
+
+ if (valid != null) {
+ setValid(valid);
+ }
+ }
+
+ public long getUserMatchingId() {
+ return _userMatchingId;
+ }
+
+ public void setUserMatchingId(long userMatchingId) {
+ _userMatchingId = userMatchingId;
+ }
+
+ public long getUserId() {
+ return _userId;
+ }
+
+ public void setUserId(long userId) {
+ _columnBitmask |= USERID_COLUMN_BITMASK;
+
+ if (!_setOriginalUserId) {
+ _setOriginalUserId = true;
+
+ _originalUserId = _userId;
+ }
+
+ _userId = userId;
+ }
+
+ public String getUserUuid() throws SystemException {
+ return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
+ }
+
+ public void setUserUuid(String userUuid) {
+ _userUuid = userUuid;
+ }
+
+ public long getOriginalUserId() {
+ return _originalUserId;
+ }
+
+ public long getWithUserId() {
+ return _withUserId;
+ }
+
+ public void setWithUserId(long withUserId) {
+ _columnBitmask |= WITHUSERID_COLUMN_BITMASK;
+
+ if (!_setOriginalWithUserId) {
+ _setOriginalWithUserId = true;
+
+ _originalWithUserId = _withUserId;
+ }
+
+ _withUserId = withUserId;
+ }
+
+ public String getWithUserUuid() throws SystemException {
+ return PortalUtil.getUserValue(getWithUserId(), "uuid", _withUserUuid);
+ }
+
+ public void setWithUserUuid(String withUserUuid) {
+ _withUserUuid = withUserUuid;
+ }
+
+ public long getOriginalWithUserId() {
+ return _originalWithUserId;
+ }
+
+ public boolean getValid() {
+ return _valid;
+ }
+
+ public boolean isValid() {
+ return _valid;
+ }
+
+ public void setValid(boolean valid) {
+ _columnBitmask |= VALID_COLUMN_BITMASK;
+
+ if (!_setOriginalValid) {
+ _setOriginalValid = true;
+
+ _originalValid = _valid;
+ }
+
+ _valid = valid;
+ }
+
+ public boolean getOriginalValid() {
+ return _originalValid;
+ }
+
+ public long getColumnBitmask() {
+ return _columnBitmask;
+ }
+
+ @Override
+ public ExpandoBridge getExpandoBridge() {
+ return ExpandoBridgeFactoryUtil.getExpandoBridge(0,
+ UserMatching.class.getName(), getPrimaryKey());
+ }
+
+ @Override
+ public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
+ ExpandoBridge expandoBridge = getExpandoBridge();
+
+ expandoBridge.setAttributes(serviceContext);
+ }
+
+ @Override
+ public UserMatching toEscapedModel() {
+ if (_escapedModelProxy == null) {
+ _escapedModelProxy = (UserMatching)ProxyUtil.newProxyInstance(_classLoader,
+ _escapedModelProxyInterfaces,
+ new AutoEscapeBeanHandler(this));
+ }
+
+ return _escapedModelProxy;
+ }
+
+ @Override
+ public Object clone() {
+ UserMatchingImpl userMatchingImpl = new UserMatchingImpl();
+
+ userMatchingImpl.setUserMatchingId(getUserMatchingId());
+ userMatchingImpl.setUserId(getUserId());
+ userMatchingImpl.setWithUserId(getWithUserId());
+ userMatchingImpl.setValid(getValid());
+
+ userMatchingImpl.resetOriginalValues();
+
+ return userMatchingImpl;
+ }
+
+ public int compareTo(UserMatching userMatching) {
+ long primaryKey = userMatching.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;
+ }
+
+ UserMatching userMatching = null;
+
+ try {
+ userMatching = (UserMatching)obj;
+ }
+ catch (ClassCastException cce) {
+ return false;
+ }
+
+ long primaryKey = userMatching.getPrimaryKey();
+
+ if (getPrimaryKey() == primaryKey) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return (int)getPrimaryKey();
+ }
+
+ @Override
+ public void resetOriginalValues() {
+ UserMatchingModelImpl userMatchingModelImpl = this;
+
+ userMatchingModelImpl._originalUserId = userMatchingModelImpl._userId;
+
+ userMatchingModelImpl._setOriginalUserId = false;
+
+ userMatchingModelImpl._originalWithUserId = userMatchingModelImpl._withUserId;
+
+ userMatchingModelImpl._setOriginalWithUserId = false;
+
+ userMatchingModelImpl._originalValid = userMatchingModelImpl._valid;
+
+ userMatchingModelImpl._setOriginalValid = false;
+
+ userMatchingModelImpl._columnBitmask = 0;
+ }
+
+ @Override
+ public CacheModel<UserMatching> toCacheModel() {
+ UserMatchingCacheModel userMatchingCacheModel = new UserMatchingCacheModel();
+
+ userMatchingCacheModel.userMatchingId = getUserMatchingId();
+
+ userMatchingCacheModel.userId = getUserId();
+
+ userMatchingCacheModel.withUserId = getWithUserId();
+
+ userMatchingCacheModel.valid = getValid();
+
+ return userMatchingCacheModel;
+ }
+
+ @Override
+ public String toString() {
+ StringBundler sb = new StringBundler(9);
+
+ sb.append("{userMatchingId=");
+ sb.append(getUserMatchingId());
+ sb.append(", userId=");
+ sb.append(getUserId());
+ sb.append(", withUserId=");
+ sb.append(getWithUserId());
+ sb.append(", valid=");
+ sb.append(getValid());
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ public String toXmlString() {
+ StringBundler sb = new StringBundler(16);
+
+ sb.append("<model><model-name>");
+ sb.append("com.pentila.entSavoie.userProperties.model.UserMatching");
+ sb.append("</model-name>");
+
+ sb.append(
+ "<column><column-name>userMatchingId</column-name><column-value><![CDATA[");
+ sb.append(getUserMatchingId());
+ 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>withUserId</column-name><column-value><![CDATA[");
+ sb.append(getWithUserId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>valid</column-name><column-value><![CDATA[");
+ sb.append(getValid());
+ sb.append("]]></column-value></column>");
+
+ sb.append("</model>");
+
+ return sb.toString();
+ }
+
+ private static ClassLoader _classLoader = UserMatching.class.getClassLoader();
+ private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
+ UserMatching.class
+ };
+ private long _userMatchingId;
+ private long _userId;
+ private String _userUuid;
+ private long _originalUserId;
+ private boolean _setOriginalUserId;
+ private long _withUserId;
+ private String _withUserUuid;
+ private long _originalWithUserId;
+ private boolean _setOriginalWithUserId;
+ private boolean _valid;
+ private boolean _originalValid;
+ private boolean _setOriginalValid;
+ private long _columnBitmask;
+ private UserMatching _escapedModelProxy;
+}
\ No newline at end of file