--- /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.UserMailSynchronisation;
+import com.pentila.entSavoie.userProperties.model.UserMailSynchronisationModel;
+
+import java.io.Serializable;
+
+import java.sql.Types;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The base model implementation for the UserMailSynchronisation service. Represents a row in the "userProperties_UserMailSynchronisation" 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.UserMailSynchronisationModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link UserMailSynchronisationImpl}.
+ * </p>
+ *
+ * @author Amblard Mathieu - Barma Igor
+ * @see UserMailSynchronisationImpl
+ * @see com.pentila.entSavoie.userProperties.model.UserMailSynchronisation
+ * @see com.pentila.entSavoie.userProperties.model.UserMailSynchronisationModel
+ * @generated
+ */
+public class UserMailSynchronisationModelImpl extends BaseModelImpl<UserMailSynchronisation>
+ implements UserMailSynchronisationModel {
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. All methods that expect a user mail synchronisation model instance should use the {@link com.pentila.entSavoie.userProperties.model.UserMailSynchronisation} interface instead.
+ */
+ public static final String TABLE_NAME = "userProperties_UserMailSynchronisation";
+ public static final Object[][] TABLE_COLUMNS = {
+ { "userId", Types.BIGINT },
+ { "lastSynchronisation", Types.TIMESTAMP }
+ };
+ public static final String TABLE_SQL_CREATE = "create table userProperties_UserMailSynchronisation (userId LONG not null primary key,lastSynchronisation DATE null)";
+ public static final String TABLE_SQL_DROP = "drop table userProperties_UserMailSynchronisation";
+ 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.UserMailSynchronisation"),
+ 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.UserMailSynchronisation"),
+ true);
+ public static final boolean COLUMN_BITMASK_ENABLED = false;
+ public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
+ "lock.expiration.time.com.pentila.entSavoie.userProperties.model.UserMailSynchronisation"));
+
+ public UserMailSynchronisationModelImpl() {
+ }
+
+ public long getPrimaryKey() {
+ return _userId;
+ }
+
+ public void setPrimaryKey(long primaryKey) {
+ setUserId(primaryKey);
+ }
+
+ public Serializable getPrimaryKeyObj() {
+ return new Long(_userId);
+ }
+
+ public void setPrimaryKeyObj(Serializable primaryKeyObj) {
+ setPrimaryKey(((Long)primaryKeyObj).longValue());
+ }
+
+ public Class<?> getModelClass() {
+ return UserMailSynchronisation.class;
+ }
+
+ public String getModelClassName() {
+ return UserMailSynchronisation.class.getName();
+ }
+
+ @Override
+ public Map<String, Object> getModelAttributes() {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+
+ attributes.put("userId", getUserId());
+ attributes.put("lastSynchronisation", getLastSynchronisation());
+
+ return attributes;
+ }
+
+ @Override
+ public void setModelAttributes(Map<String, Object> attributes) {
+ Long userId = (Long)attributes.get("userId");
+
+ if (userId != null) {
+ setUserId(userId);
+ }
+
+ Date lastSynchronisation = (Date)attributes.get("lastSynchronisation");
+
+ if (lastSynchronisation != null) {
+ setLastSynchronisation(lastSynchronisation);
+ }
+ }
+
+ public long getUserId() {
+ return _userId;
+ }
+
+ public void setUserId(long userId) {
+ _userId = userId;
+ }
+
+ public String getUserUuid() throws SystemException {
+ return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
+ }
+
+ public void setUserUuid(String userUuid) {
+ _userUuid = userUuid;
+ }
+
+ public Date getLastSynchronisation() {
+ return _lastSynchronisation;
+ }
+
+ public void setLastSynchronisation(Date lastSynchronisation) {
+ _lastSynchronisation = lastSynchronisation;
+ }
+
+ @Override
+ public ExpandoBridge getExpandoBridge() {
+ return ExpandoBridgeFactoryUtil.getExpandoBridge(0,
+ UserMailSynchronisation.class.getName(), getPrimaryKey());
+ }
+
+ @Override
+ public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
+ ExpandoBridge expandoBridge = getExpandoBridge();
+
+ expandoBridge.setAttributes(serviceContext);
+ }
+
+ @Override
+ public UserMailSynchronisation toEscapedModel() {
+ if (_escapedModelProxy == null) {
+ _escapedModelProxy = (UserMailSynchronisation)ProxyUtil.newProxyInstance(_classLoader,
+ _escapedModelProxyInterfaces,
+ new AutoEscapeBeanHandler(this));
+ }
+
+ return _escapedModelProxy;
+ }
+
+ @Override
+ public Object clone() {
+ UserMailSynchronisationImpl userMailSynchronisationImpl = new UserMailSynchronisationImpl();
+
+ userMailSynchronisationImpl.setUserId(getUserId());
+ userMailSynchronisationImpl.setLastSynchronisation(getLastSynchronisation());
+
+ userMailSynchronisationImpl.resetOriginalValues();
+
+ return userMailSynchronisationImpl;
+ }
+
+ public int compareTo(UserMailSynchronisation userMailSynchronisation) {
+ long primaryKey = userMailSynchronisation.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;
+ }
+
+ UserMailSynchronisation userMailSynchronisation = null;
+
+ try {
+ userMailSynchronisation = (UserMailSynchronisation)obj;
+ }
+ catch (ClassCastException cce) {
+ return false;
+ }
+
+ long primaryKey = userMailSynchronisation.getPrimaryKey();
+
+ if (getPrimaryKey() == primaryKey) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return (int)getPrimaryKey();
+ }
+
+ @Override
+ public void resetOriginalValues() {
+ }
+
+ @Override
+ public CacheModel<UserMailSynchronisation> toCacheModel() {
+ UserMailSynchronisationCacheModel userMailSynchronisationCacheModel = new UserMailSynchronisationCacheModel();
+
+ userMailSynchronisationCacheModel.userId = getUserId();
+
+ Date lastSynchronisation = getLastSynchronisation();
+
+ if (lastSynchronisation != null) {
+ userMailSynchronisationCacheModel.lastSynchronisation = lastSynchronisation.getTime();
+ }
+ else {
+ userMailSynchronisationCacheModel.lastSynchronisation = Long.MIN_VALUE;
+ }
+
+ return userMailSynchronisationCacheModel;
+ }
+
+ @Override
+ public String toString() {
+ StringBundler sb = new StringBundler(5);
+
+ sb.append("{userId=");
+ sb.append(getUserId());
+ sb.append(", lastSynchronisation=");
+ sb.append(getLastSynchronisation());
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ public String toXmlString() {
+ StringBundler sb = new StringBundler(10);
+
+ sb.append("<model><model-name>");
+ sb.append(
+ "com.pentila.entSavoie.userProperties.model.UserMailSynchronisation");
+ sb.append("</model-name>");
+
+ sb.append(
+ "<column><column-name>userId</column-name><column-value><![CDATA[");
+ sb.append(getUserId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>lastSynchronisation</column-name><column-value><![CDATA[");
+ sb.append(getLastSynchronisation());
+ sb.append("]]></column-value></column>");
+
+ sb.append("</model>");
+
+ return sb.toString();
+ }
+
+ private static ClassLoader _classLoader = UserMailSynchronisation.class.getClassLoader();
+ private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
+ UserMailSynchronisation.class
+ };
+ private long _userId;
+ private String _userUuid;
+ private Date _lastSynchronisation;
+ private UserMailSynchronisation _escapedModelProxy;
+}
\ No newline at end of file