--- /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.carnetDAdresses.model.impl;
+
+import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
+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.kernel.util.StringPool;
+import com.liferay.portal.model.CacheModel;
+import com.liferay.portal.model.impl.BaseModelImpl;
+import com.liferay.portal.service.ServiceContext;
+
+import com.liferay.portlet.expando.model.ExpandoBridge;
+import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
+
+import com.pentila.entSavoie.carnetDAdresses.model.FicheProperty;
+import com.pentila.entSavoie.carnetDAdresses.model.FichePropertyModel;
+
+import java.io.Serializable;
+
+import java.sql.Types;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The base model implementation for the FicheProperty service. Represents a row in the "CarnetAdresses_FicheProperty" database table, with each column mapped to a property of this class.
+ *
+ * <p>
+ * This implementation and its corresponding interface {@link com.pentila.entSavoie.carnetDAdresses.model.FichePropertyModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link FichePropertyImpl}.
+ * </p>
+ *
+ * @author SIX Lancelot et BARMA Igor
+ * @see FichePropertyImpl
+ * @see com.pentila.entSavoie.carnetDAdresses.model.FicheProperty
+ * @see com.pentila.entSavoie.carnetDAdresses.model.FichePropertyModel
+ * @generated
+ */
+public class FichePropertyModelImpl extends BaseModelImpl<FicheProperty>
+ implements FichePropertyModel {
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. All methods that expect a fiche property model instance should use the {@link com.pentila.entSavoie.carnetDAdresses.model.FicheProperty} interface instead.
+ */
+ public static final String TABLE_NAME = "CarnetAdresses_FicheProperty";
+ public static final Object[][] TABLE_COLUMNS = {
+ { "ficheId", Types.BIGINT },
+ { "groupId", Types.BIGINT },
+ { "propertyId", Types.BIGINT },
+ { "name", Types.VARCHAR },
+ { "value_", Types.VARCHAR },
+ { "type_", Types.VARCHAR }
+ };
+ public static final String TABLE_SQL_CREATE = "create table CarnetAdresses_FicheProperty (ficheId LONG,groupId LONG,propertyId LONG not null primary key,name VARCHAR(75) null,value_ VARCHAR(75) null,type_ VARCHAR(75) null)";
+ public static final String TABLE_SQL_DROP = "drop table CarnetAdresses_FicheProperty";
+ 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.carnetDAdresses.model.FicheProperty"),
+ true);
+ public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
+ "value.object.finder.cache.enabled.com.pentila.entSavoie.carnetDAdresses.model.FicheProperty"),
+ true);
+ public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
+ "value.object.column.bitmask.enabled.com.pentila.entSavoie.carnetDAdresses.model.FicheProperty"),
+ true);
+ public static long FICHEID_COLUMN_BITMASK = 1L;
+ public static long GROUPID_COLUMN_BITMASK = 2L;
+ public static long NAME_COLUMN_BITMASK = 4L;
+ public static long TYPE_COLUMN_BITMASK = 8L;
+ public static long VALUE__COLUMN_BITMASK = 16L;
+ public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
+ "lock.expiration.time.com.pentila.entSavoie.carnetDAdresses.model.FicheProperty"));
+
+ public FichePropertyModelImpl() {
+ }
+
+ public long getPrimaryKey() {
+ return _propertyId;
+ }
+
+ public void setPrimaryKey(long primaryKey) {
+ setPropertyId(primaryKey);
+ }
+
+ public Serializable getPrimaryKeyObj() {
+ return new Long(_propertyId);
+ }
+
+ public void setPrimaryKeyObj(Serializable primaryKeyObj) {
+ setPrimaryKey(((Long)primaryKeyObj).longValue());
+ }
+
+ public Class<?> getModelClass() {
+ return FicheProperty.class;
+ }
+
+ public String getModelClassName() {
+ return FicheProperty.class.getName();
+ }
+
+ @Override
+ public Map<String, Object> getModelAttributes() {
+ Map<String, Object> attributes = new HashMap<String, Object>();
+
+ attributes.put("ficheId", getFicheId());
+ attributes.put("groupId", getGroupId());
+ attributes.put("propertyId", getPropertyId());
+ attributes.put("name", getName());
+ attributes.put("value_", getValue_());
+ attributes.put("type", getType());
+
+ return attributes;
+ }
+
+ @Override
+ public void setModelAttributes(Map<String, Object> attributes) {
+ Long ficheId = (Long)attributes.get("ficheId");
+
+ if (ficheId != null) {
+ setFicheId(ficheId);
+ }
+
+ Long groupId = (Long)attributes.get("groupId");
+
+ if (groupId != null) {
+ setGroupId(groupId);
+ }
+
+ Long propertyId = (Long)attributes.get("propertyId");
+
+ if (propertyId != null) {
+ setPropertyId(propertyId);
+ }
+
+ String name = (String)attributes.get("name");
+
+ if (name != null) {
+ setName(name);
+ }
+
+ String value_ = (String)attributes.get("value_");
+
+ if (value_ != null) {
+ setValue_(value_);
+ }
+
+ String type = (String)attributes.get("type");
+
+ if (type != null) {
+ setType(type);
+ }
+ }
+
+ public long getFicheId() {
+ return _ficheId;
+ }
+
+ public void setFicheId(long ficheId) {
+ _columnBitmask |= FICHEID_COLUMN_BITMASK;
+
+ if (!_setOriginalFicheId) {
+ _setOriginalFicheId = true;
+
+ _originalFicheId = _ficheId;
+ }
+
+ _ficheId = ficheId;
+ }
+
+ public long getOriginalFicheId() {
+ return _originalFicheId;
+ }
+
+ public long getGroupId() {
+ return _groupId;
+ }
+
+ public void setGroupId(long groupId) {
+ _columnBitmask |= GROUPID_COLUMN_BITMASK;
+
+ if (!_setOriginalGroupId) {
+ _setOriginalGroupId = true;
+
+ _originalGroupId = _groupId;
+ }
+
+ _groupId = groupId;
+ }
+
+ public long getOriginalGroupId() {
+ return _originalGroupId;
+ }
+
+ public long getPropertyId() {
+ return _propertyId;
+ }
+
+ public void setPropertyId(long propertyId) {
+ _propertyId = propertyId;
+ }
+
+ public String getName() {
+ if (_name == null) {
+ return StringPool.BLANK;
+ }
+ else {
+ return _name;
+ }
+ }
+
+ public void setName(String name) {
+ _columnBitmask |= NAME_COLUMN_BITMASK;
+
+ if (_originalName == null) {
+ _originalName = _name;
+ }
+
+ _name = name;
+ }
+
+ public String getOriginalName() {
+ return GetterUtil.getString(_originalName);
+ }
+
+ public String getValue_() {
+ if (_value_ == null) {
+ return StringPool.BLANK;
+ }
+ else {
+ return _value_;
+ }
+ }
+
+ public void setValue_(String value_) {
+ _columnBitmask |= VALUE__COLUMN_BITMASK;
+
+ if (_originalValue_ == null) {
+ _originalValue_ = _value_;
+ }
+
+ _value_ = value_;
+ }
+
+ public String getOriginalValue_() {
+ return GetterUtil.getString(_originalValue_);
+ }
+
+ public String getType() {
+ if (_type == null) {
+ return StringPool.BLANK;
+ }
+ else {
+ return _type;
+ }
+ }
+
+ public void setType(String type) {
+ _columnBitmask |= TYPE_COLUMN_BITMASK;
+
+ if (_originalType == null) {
+ _originalType = _type;
+ }
+
+ _type = type;
+ }
+
+ public String getOriginalType() {
+ return GetterUtil.getString(_originalType);
+ }
+
+ public long getColumnBitmask() {
+ return _columnBitmask;
+ }
+
+ @Override
+ public ExpandoBridge getExpandoBridge() {
+ return ExpandoBridgeFactoryUtil.getExpandoBridge(0,
+ FicheProperty.class.getName(), getPrimaryKey());
+ }
+
+ @Override
+ public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
+ ExpandoBridge expandoBridge = getExpandoBridge();
+
+ expandoBridge.setAttributes(serviceContext);
+ }
+
+ @Override
+ public FicheProperty toEscapedModel() {
+ if (_escapedModelProxy == null) {
+ _escapedModelProxy = (FicheProperty)ProxyUtil.newProxyInstance(_classLoader,
+ _escapedModelProxyInterfaces,
+ new AutoEscapeBeanHandler(this));
+ }
+
+ return _escapedModelProxy;
+ }
+
+ @Override
+ public Object clone() {
+ FichePropertyImpl fichePropertyImpl = new FichePropertyImpl();
+
+ fichePropertyImpl.setFicheId(getFicheId());
+ fichePropertyImpl.setGroupId(getGroupId());
+ fichePropertyImpl.setPropertyId(getPropertyId());
+ fichePropertyImpl.setName(getName());
+ fichePropertyImpl.setValue_(getValue_());
+ fichePropertyImpl.setType(getType());
+
+ fichePropertyImpl.resetOriginalValues();
+
+ return fichePropertyImpl;
+ }
+
+ public int compareTo(FicheProperty ficheProperty) {
+ long primaryKey = ficheProperty.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;
+ }
+
+ FicheProperty ficheProperty = null;
+
+ try {
+ ficheProperty = (FicheProperty)obj;
+ }
+ catch (ClassCastException cce) {
+ return false;
+ }
+
+ long primaryKey = ficheProperty.getPrimaryKey();
+
+ if (getPrimaryKey() == primaryKey) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return (int)getPrimaryKey();
+ }
+
+ @Override
+ public void resetOriginalValues() {
+ FichePropertyModelImpl fichePropertyModelImpl = this;
+
+ fichePropertyModelImpl._originalFicheId = fichePropertyModelImpl._ficheId;
+
+ fichePropertyModelImpl._setOriginalFicheId = false;
+
+ fichePropertyModelImpl._originalGroupId = fichePropertyModelImpl._groupId;
+
+ fichePropertyModelImpl._setOriginalGroupId = false;
+
+ fichePropertyModelImpl._originalName = fichePropertyModelImpl._name;
+
+ fichePropertyModelImpl._originalValue_ = fichePropertyModelImpl._value_;
+
+ fichePropertyModelImpl._originalType = fichePropertyModelImpl._type;
+
+ fichePropertyModelImpl._columnBitmask = 0;
+ }
+
+ @Override
+ public CacheModel<FicheProperty> toCacheModel() {
+ FichePropertyCacheModel fichePropertyCacheModel = new FichePropertyCacheModel();
+
+ fichePropertyCacheModel.ficheId = getFicheId();
+
+ fichePropertyCacheModel.groupId = getGroupId();
+
+ fichePropertyCacheModel.propertyId = getPropertyId();
+
+ fichePropertyCacheModel.name = getName();
+
+ String name = fichePropertyCacheModel.name;
+
+ if ((name != null) && (name.length() == 0)) {
+ fichePropertyCacheModel.name = null;
+ }
+
+ fichePropertyCacheModel.value_ = getValue_();
+
+ String value_ = fichePropertyCacheModel.value_;
+
+ if ((value_ != null) && (value_.length() == 0)) {
+ fichePropertyCacheModel.value_ = null;
+ }
+
+ fichePropertyCacheModel.type = getType();
+
+ String type = fichePropertyCacheModel.type;
+
+ if ((type != null) && (type.length() == 0)) {
+ fichePropertyCacheModel.type = null;
+ }
+
+ return fichePropertyCacheModel;
+ }
+
+ @Override
+ public String toString() {
+ StringBundler sb = new StringBundler(13);
+
+ sb.append("{ficheId=");
+ sb.append(getFicheId());
+ sb.append(", groupId=");
+ sb.append(getGroupId());
+ sb.append(", propertyId=");
+ sb.append(getPropertyId());
+ sb.append(", name=");
+ sb.append(getName());
+ sb.append(", value_=");
+ sb.append(getValue_());
+ sb.append(", type=");
+ sb.append(getType());
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ public String toXmlString() {
+ StringBundler sb = new StringBundler(22);
+
+ sb.append("<model><model-name>");
+ sb.append("com.pentila.entSavoie.carnetDAdresses.model.FicheProperty");
+ sb.append("</model-name>");
+
+ sb.append(
+ "<column><column-name>ficheId</column-name><column-value><![CDATA[");
+ sb.append(getFicheId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>groupId</column-name><column-value><![CDATA[");
+ sb.append(getGroupId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>propertyId</column-name><column-value><![CDATA[");
+ sb.append(getPropertyId());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>name</column-name><column-value><![CDATA[");
+ sb.append(getName());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>value_</column-name><column-value><![CDATA[");
+ sb.append(getValue_());
+ sb.append("]]></column-value></column>");
+ sb.append(
+ "<column><column-name>type</column-name><column-value><![CDATA[");
+ sb.append(getType());
+ sb.append("]]></column-value></column>");
+
+ sb.append("</model>");
+
+ return sb.toString();
+ }
+
+ private static ClassLoader _classLoader = FicheProperty.class.getClassLoader();
+ private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
+ FicheProperty.class
+ };
+ private long _ficheId;
+ private long _originalFicheId;
+ private boolean _setOriginalFicheId;
+ private long _groupId;
+ private long _originalGroupId;
+ private boolean _setOriginalGroupId;
+ private long _propertyId;
+ private String _name;
+ private String _originalName;
+ private String _value_;
+ private String _originalValue_;
+ private String _type;
+ private String _originalType;
+ private long _columnBitmask;
+ private FicheProperty _escapedModelProxy;
+}
\ No newline at end of file