Java tutorial
/** * Copyright (c) 2000-2013 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 at.bibbox.reactjsservice.model.impl; import at.bibbox.reactjsservice.model.ToolInformation; import at.bibbox.reactjsservice.model.ToolInformationModel; import at.bibbox.reactjsservice.model.ToolInformationSoap; import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler; import com.liferay.portal.kernel.json.JSON; 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 java.io.Serializable; import java.sql.Types; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * The base model implementation for the ToolInformation service. Represents a row in the "reactjsservice_ToolInformation" database table, with each column mapped to a property of this class. * * <p> * This implementation and its corresponding interface {@link at.bibbox.reactjsservice.model.ToolInformationModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link ToolInformationImpl}. * </p> * * @author reihsr * @see ToolInformationImpl * @see at.bibbox.reactjsservice.model.ToolInformation * @see at.bibbox.reactjsservice.model.ToolInformationModel * @generated */ @JSON(strict = true) public class ToolInformationModelImpl extends BaseModelImpl<ToolInformation> implements ToolInformationModel { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this class directly. All methods that expect a tool information model instance should use the {@link at.bibbox.reactjsservice.model.ToolInformation} interface instead. */ public static final String TABLE_NAME = "reactjsservice_ToolInformation"; public static final Object[][] TABLE_COLUMNS = { { "toolInformationId", Types.BIGINT }, { "gitUUID", Types.VARCHAR }, { "logourl", Types.VARCHAR }, { "name", Types.VARCHAR }, { "category", Types.VARCHAR }, { "company", Types.VARCHAR }, { "demourl", Types.VARCHAR }, { "downloadurl", Types.VARCHAR }, { "toolId", Types.VARCHAR }, { "platform", Types.VARCHAR }, { "license", Types.VARCHAR }, { "description", Types.VARCHAR } }; public static final String TABLE_SQL_CREATE = "create table reactjsservice_ToolInformation (toolInformationId LONG not null primary key,gitUUID VARCHAR(75) null,logourl VARCHAR(75) null,name VARCHAR(75) null,category VARCHAR(75) null,company VARCHAR(75) null,demourl VARCHAR(75) null,downloadurl VARCHAR(75) null,toolId VARCHAR(75) null,platform VARCHAR(75) null,license VARCHAR(75) null,description VARCHAR(75) null)"; public static final String TABLE_SQL_DROP = "drop table reactjsservice_ToolInformation"; public static final String ORDER_BY_JPQL = " ORDER BY toolInformation.name ASC"; public static final String ORDER_BY_SQL = " ORDER BY reactjsservice_ToolInformation.name ASC"; 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.at.bibbox.reactjsservice.model.ToolInformation"), true); public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps .get("value.object.finder.cache.enabled.at.bibbox.reactjsservice.model.ToolInformation"), true); public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps .get("value.object.column.bitmask.enabled.at.bibbox.reactjsservice.model.ToolInformation"), true); public static long CATEGORY_COLUMN_BITMASK = 1L; public static long NAME_COLUMN_BITMASK = 2L; /** * Converts the soap model instance into a normal model instance. * * @param soapModel the soap model instance to convert * @return the normal model instance */ public static ToolInformation toModel(ToolInformationSoap soapModel) { if (soapModel == null) { return null; } ToolInformation model = new ToolInformationImpl(); model.setToolInformationId(soapModel.getToolInformationId()); model.setGitUUID(soapModel.getGitUUID()); model.setLogourl(soapModel.getLogourl()); model.setName(soapModel.getName()); model.setCategory(soapModel.getCategory()); model.setCompany(soapModel.getCompany()); model.setDemourl(soapModel.getDemourl()); model.setDownloadurl(soapModel.getDownloadurl()); model.setToolId(soapModel.getToolId()); model.setPlatform(soapModel.getPlatform()); model.setLicense(soapModel.getLicense()); model.setDescription(soapModel.getDescription()); return model; } /** * Converts the soap model instances into normal model instances. * * @param soapModels the soap model instances to convert * @return the normal model instances */ public static List<ToolInformation> toModels(ToolInformationSoap[] soapModels) { if (soapModels == null) { return null; } List<ToolInformation> models = new ArrayList<ToolInformation>(soapModels.length); for (ToolInformationSoap soapModel : soapModels) { models.add(toModel(soapModel)); } return models; } public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps .get("lock.expiration.time.at.bibbox.reactjsservice.model.ToolInformation")); public ToolInformationModelImpl() { } @Override public long getPrimaryKey() { return _toolInformationId; } @Override public void setPrimaryKey(long primaryKey) { setToolInformationId(primaryKey); } @Override public Serializable getPrimaryKeyObj() { return _toolInformationId; } @Override public void setPrimaryKeyObj(Serializable primaryKeyObj) { setPrimaryKey(((Long) primaryKeyObj).longValue()); } @Override public Class<?> getModelClass() { return ToolInformation.class; } @Override public String getModelClassName() { return ToolInformation.class.getName(); } @Override public Map<String, Object> getModelAttributes() { Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put("toolInformationId", getToolInformationId()); attributes.put("gitUUID", getGitUUID()); attributes.put("logourl", getLogourl()); attributes.put("name", getName()); attributes.put("category", getCategory()); attributes.put("company", getCompany()); attributes.put("demourl", getDemourl()); attributes.put("downloadurl", getDownloadurl()); attributes.put("toolId", getToolId()); attributes.put("platform", getPlatform()); attributes.put("license", getLicense()); attributes.put("description", getDescription()); return attributes; } @Override public void setModelAttributes(Map<String, Object> attributes) { Long toolInformationId = (Long) attributes.get("toolInformationId"); if (toolInformationId != null) { setToolInformationId(toolInformationId); } String gitUUID = (String) attributes.get("gitUUID"); if (gitUUID != null) { setGitUUID(gitUUID); } String logourl = (String) attributes.get("logourl"); if (logourl != null) { setLogourl(logourl); } String name = (String) attributes.get("name"); if (name != null) { setName(name); } String category = (String) attributes.get("category"); if (category != null) { setCategory(category); } String company = (String) attributes.get("company"); if (company != null) { setCompany(company); } String demourl = (String) attributes.get("demourl"); if (demourl != null) { setDemourl(demourl); } String downloadurl = (String) attributes.get("downloadurl"); if (downloadurl != null) { setDownloadurl(downloadurl); } String toolId = (String) attributes.get("toolId"); if (toolId != null) { setToolId(toolId); } String platform = (String) attributes.get("platform"); if (platform != null) { setPlatform(platform); } String license = (String) attributes.get("license"); if (license != null) { setLicense(license); } String description = (String) attributes.get("description"); if (description != null) { setDescription(description); } } @JSON @Override public long getToolInformationId() { return _toolInformationId; } @Override public void setToolInformationId(long toolInformationId) { _toolInformationId = toolInformationId; } @JSON @Override public String getGitUUID() { if (_gitUUID == null) { return StringPool.BLANK; } else { return _gitUUID; } } @Override public void setGitUUID(String gitUUID) { _gitUUID = gitUUID; } @JSON @Override public String getLogourl() { if (_logourl == null) { return StringPool.BLANK; } else { return _logourl; } } @Override public void setLogourl(String logourl) { _logourl = logourl; } @JSON @Override public String getName() { if (_name == null) { return StringPool.BLANK; } else { return _name; } } @Override public void setName(String name) { _columnBitmask = -1L; _name = name; } @JSON @Override public String getCategory() { if (_category == null) { return StringPool.BLANK; } else { return _category; } } @Override public void setCategory(String category) { _columnBitmask |= CATEGORY_COLUMN_BITMASK; if (_originalCategory == null) { _originalCategory = _category; } _category = category; } public String getOriginalCategory() { return GetterUtil.getString(_originalCategory); } @JSON @Override public String getCompany() { if (_company == null) { return StringPool.BLANK; } else { return _company; } } @Override public void setCompany(String company) { _company = company; } @JSON @Override public String getDemourl() { if (_demourl == null) { return StringPool.BLANK; } else { return _demourl; } } @Override public void setDemourl(String demourl) { _demourl = demourl; } @JSON @Override public String getDownloadurl() { if (_downloadurl == null) { return StringPool.BLANK; } else { return _downloadurl; } } @Override public void setDownloadurl(String downloadurl) { _downloadurl = downloadurl; } @JSON @Override public String getToolId() { if (_toolId == null) { return StringPool.BLANK; } else { return _toolId; } } @Override public void setToolId(String toolId) { _toolId = toolId; } @JSON @Override public String getPlatform() { if (_platform == null) { return StringPool.BLANK; } else { return _platform; } } @Override public void setPlatform(String platform) { _platform = platform; } @JSON @Override public String getLicense() { if (_license == null) { return StringPool.BLANK; } else { return _license; } } @Override public void setLicense(String license) { _license = license; } @JSON @Override public String getDescription() { if (_description == null) { return StringPool.BLANK; } else { return _description; } } @Override public void setDescription(String description) { _description = description; } public long getColumnBitmask() { return _columnBitmask; } @Override public ExpandoBridge getExpandoBridge() { return ExpandoBridgeFactoryUtil.getExpandoBridge(0, ToolInformation.class.getName(), getPrimaryKey()); } @Override public void setExpandoBridgeAttributes(ServiceContext serviceContext) { ExpandoBridge expandoBridge = getExpandoBridge(); expandoBridge.setAttributes(serviceContext); } @Override public ToolInformation toEscapedModel() { if (_escapedModel == null) { _escapedModel = (ToolInformation) ProxyUtil.newProxyInstance(_classLoader, _escapedModelInterfaces, new AutoEscapeBeanHandler(this)); } return _escapedModel; } @Override public Object clone() { ToolInformationImpl toolInformationImpl = new ToolInformationImpl(); toolInformationImpl.setToolInformationId(getToolInformationId()); toolInformationImpl.setGitUUID(getGitUUID()); toolInformationImpl.setLogourl(getLogourl()); toolInformationImpl.setName(getName()); toolInformationImpl.setCategory(getCategory()); toolInformationImpl.setCompany(getCompany()); toolInformationImpl.setDemourl(getDemourl()); toolInformationImpl.setDownloadurl(getDownloadurl()); toolInformationImpl.setToolId(getToolId()); toolInformationImpl.setPlatform(getPlatform()); toolInformationImpl.setLicense(getLicense()); toolInformationImpl.setDescription(getDescription()); toolInformationImpl.resetOriginalValues(); return toolInformationImpl; } @Override public int compareTo(ToolInformation toolInformation) { int value = 0; value = getName().compareTo(toolInformation.getName()); if (value != 0) { return value; } return 0; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof ToolInformation)) { return false; } ToolInformation toolInformation = (ToolInformation) obj; long primaryKey = toolInformation.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } } @Override public int hashCode() { return (int) getPrimaryKey(); } @Override public void resetOriginalValues() { ToolInformationModelImpl toolInformationModelImpl = this; toolInformationModelImpl._originalCategory = toolInformationModelImpl._category; toolInformationModelImpl._columnBitmask = 0; } @Override public CacheModel<ToolInformation> toCacheModel() { ToolInformationCacheModel toolInformationCacheModel = new ToolInformationCacheModel(); toolInformationCacheModel.toolInformationId = getToolInformationId(); toolInformationCacheModel.gitUUID = getGitUUID(); String gitUUID = toolInformationCacheModel.gitUUID; if ((gitUUID != null) && (gitUUID.length() == 0)) { toolInformationCacheModel.gitUUID = null; } toolInformationCacheModel.logourl = getLogourl(); String logourl = toolInformationCacheModel.logourl; if ((logourl != null) && (logourl.length() == 0)) { toolInformationCacheModel.logourl = null; } toolInformationCacheModel.name = getName(); String name = toolInformationCacheModel.name; if ((name != null) && (name.length() == 0)) { toolInformationCacheModel.name = null; } toolInformationCacheModel.category = getCategory(); String category = toolInformationCacheModel.category; if ((category != null) && (category.length() == 0)) { toolInformationCacheModel.category = null; } toolInformationCacheModel.company = getCompany(); String company = toolInformationCacheModel.company; if ((company != null) && (company.length() == 0)) { toolInformationCacheModel.company = null; } toolInformationCacheModel.demourl = getDemourl(); String demourl = toolInformationCacheModel.demourl; if ((demourl != null) && (demourl.length() == 0)) { toolInformationCacheModel.demourl = null; } toolInformationCacheModel.downloadurl = getDownloadurl(); String downloadurl = toolInformationCacheModel.downloadurl; if ((downloadurl != null) && (downloadurl.length() == 0)) { toolInformationCacheModel.downloadurl = null; } toolInformationCacheModel.toolId = getToolId(); String toolId = toolInformationCacheModel.toolId; if ((toolId != null) && (toolId.length() == 0)) { toolInformationCacheModel.toolId = null; } toolInformationCacheModel.platform = getPlatform(); String platform = toolInformationCacheModel.platform; if ((platform != null) && (platform.length() == 0)) { toolInformationCacheModel.platform = null; } toolInformationCacheModel.license = getLicense(); String license = toolInformationCacheModel.license; if ((license != null) && (license.length() == 0)) { toolInformationCacheModel.license = null; } toolInformationCacheModel.description = getDescription(); String description = toolInformationCacheModel.description; if ((description != null) && (description.length() == 0)) { toolInformationCacheModel.description = null; } return toolInformationCacheModel; } @Override public String toString() { StringBundler sb = new StringBundler(25); sb.append("{toolInformationId="); sb.append(getToolInformationId()); sb.append(", gitUUID="); sb.append(getGitUUID()); sb.append(", logourl="); sb.append(getLogourl()); sb.append(", name="); sb.append(getName()); sb.append(", category="); sb.append(getCategory()); sb.append(", company="); sb.append(getCompany()); sb.append(", demourl="); sb.append(getDemourl()); sb.append(", downloadurl="); sb.append(getDownloadurl()); sb.append(", toolId="); sb.append(getToolId()); sb.append(", platform="); sb.append(getPlatform()); sb.append(", license="); sb.append(getLicense()); sb.append(", description="); sb.append(getDescription()); sb.append("}"); return sb.toString(); } @Override public String toXmlString() { StringBundler sb = new StringBundler(40); sb.append("<model><model-name>"); sb.append("at.bibbox.reactjsservice.model.ToolInformation"); sb.append("</model-name>"); sb.append("<column><column-name>toolInformationId</column-name><column-value><![CDATA["); sb.append(getToolInformationId()); sb.append("]]></column-value></column>"); sb.append("<column><column-name>gitUUID</column-name><column-value><![CDATA["); sb.append(getGitUUID()); sb.append("]]></column-value></column>"); sb.append("<column><column-name>logourl</column-name><column-value><![CDATA["); sb.append(getLogourl()); 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>category</column-name><column-value><![CDATA["); sb.append(getCategory()); sb.append("]]></column-value></column>"); sb.append("<column><column-name>company</column-name><column-value><![CDATA["); sb.append(getCompany()); sb.append("]]></column-value></column>"); sb.append("<column><column-name>demourl</column-name><column-value><![CDATA["); sb.append(getDemourl()); sb.append("]]></column-value></column>"); sb.append("<column><column-name>downloadurl</column-name><column-value><![CDATA["); sb.append(getDownloadurl()); sb.append("]]></column-value></column>"); sb.append("<column><column-name>toolId</column-name><column-value><![CDATA["); sb.append(getToolId()); sb.append("]]></column-value></column>"); sb.append("<column><column-name>platform</column-name><column-value><![CDATA["); sb.append(getPlatform()); sb.append("]]></column-value></column>"); sb.append("<column><column-name>license</column-name><column-value><![CDATA["); sb.append(getLicense()); sb.append("]]></column-value></column>"); sb.append("<column><column-name>description</column-name><column-value><![CDATA["); sb.append(getDescription()); sb.append("]]></column-value></column>"); sb.append("</model>"); return sb.toString(); } private static ClassLoader _classLoader = ToolInformation.class.getClassLoader(); private static Class<?>[] _escapedModelInterfaces = new Class[] { ToolInformation.class }; private long _toolInformationId; private String _gitUUID; private String _logourl; private String _name; private String _category; private String _originalCategory; private String _company; private String _demourl; private String _downloadurl; private String _toolId; private String _platform; private String _license; private String _description; private long _columnBitmask; private ToolInformation _escapedModel; }