liferay-service-builder_6_1_0.dtd: Elements - Entities - Source | Intro - Index
FRAMES / NO FRAMES

liferay-service-builder_6_1_0.dtd

<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd">



<service-builder> Root element

The service-builder element is the root of the deployment descriptor for a Service Builder descriptor that is used to generate services available to portlets. The Service Builder saves the developer time by generating Spring utilities, SOAP utilities, and Hibernate persistence classes to ease the development of services.

<service-builder>'s children
NameCardinality
authorOne or none
entityAny number
exceptionsOne or none
namespaceOnly one
service-builder-importAny number
<service-builder>'s attributes
NameValuesDefault
auto-namespace-tables
package-path
Element's model:

(author?, namespace, entity*, exceptions?, service-builder-import*)


@package-path Attribute of service-builder

The package-path value specifies the package of the generated code.

The auto-namespace-tables value specifies whether or not to automatically namespace tables. The default value is false for core services and true for plugin services.

Required


@auto-namespace-tables Attribute of service-builder

The package-path value specifies the package of the generated code.

The auto-namespace-tables value specifies whether or not to automatically namespace tables. The default value is false for core services and true for plugin services.


<author> Child of service-builder

The author element is the name of the user associated with the generated code.


<namespace> Child of service-builder

The namespace element must be a unique namespace for this component. Table names will be prepended with this namespace. Generated JSON JavaScript will be scoped to this namespace as well (i.e., Liferay.Service.Test.* if the namespace is Test).


<entity> Child of service-builder

An entity usually represents a business facade and a table in the database. If an entity does not have any columns, then it only represents a business facade. The Service Builder will always generate an empty business facade POJO if it does not exist. Upon subsequent generations, the Service Builder will check to see if the business facade already exists. If it exists and has additional methods, then the Service Builder will also update the SOAP wrappers.

If an entity does have columns, then the value object, the POJO class that is mapped to the database, and other persistence utilities are also generated based on the order and finder elements.

<entity>'s children
NameCardinality
columnAny number
finderAny number
orderOne or none
referenceAny number
tx-requiredAny number
<entity>'s attributes
NameValuesDefault
cache-enabled
data-source
human-name
json-enabled
local-service
name
persistence-class
remote-service
session-factory
table
tx-manager
uuid
uuid-accessor
Element's model:

(column*, order?, finder*, reference*, tx-required*)


@name Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.

Required


@human-name Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


@table Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


@uuid Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


@uuid-accessor Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


@local-service Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


@remote-service Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


@persistence-class Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


@data-source Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


@session-factory Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


@tx-manager Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


@cache-enabled Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


@json-enabled Attribute of entity

The name value specifies the name of the entity.

The human-name value specifies the readable name to use when generating documentation for this entity. If none is specified, one will be generated from the name.

The table value specifies the name of the table that this entity maps to in the database. If this value is not set, then the name of the table is the same as the name of the entity.

If the uuid value is true, then the service will generate a UUID column for the service. This column will automatically be populated with a UUID. Developers will also be able to find and remove based on that UUID. The default value is false.

If the uuid-accessor value is true, then the service will generate a UUID column accessor for the service. This accessor will provide a fast and type-safe way to access entity's UUID.

If the local-service value is true, then the service will generate the local interfaces for the service. The default value is false.

If the remote-service value is true, then the service will generate remote interfaces for the service. The default value is true.

The persistence-class value specifies the name of your custom persistence class. This class must implement the generated persistence interface or extend the generated persistence class. This allows you to override default behavior without modifying the generated persistence class.

You can generate classes to use a custom data source and session factory. Point "spring.configs" in portal.properties to load your custom Spring XML with the definitions of your custom data source and session factory. Then set the data-source and session-factory values to your custom values.

The data-source value specifies the data source target that is set to the persistence class. The default value is the Liferay data source. This is used in conjunction with session-factory. See data-source-spring.xml.

The session-factory value specifies the session factory that is set to the persistence class. The default value is the Liferay session factory. This is used in conjunction with data-source. See data-source-spring.xml.

The tx-manager value specifies the transaction manager that Spring uses. The default value is the Spring Hibernate transaction manager that wraps the Liferay data source and session factory. See data-source-spring.xml. Set this attribute to "none" to disable transaction management.

The cache-enabled value specifies whether or not to cache this queries for this entity. Set this to false if data in the table will be updated by other programs. The default value is true.

The json-enabled value specifies whether or not the entity should be annotated for JSON serialization. By default, if the remote-service value is true, then the json-enabled value is true.


<column> Child of entity

The column element represents a column in the database.

<column>'s attributes
NameValuesDefault
accessor
convert-null
db-name
entity
filter-primary
id-param
id-type
json-enabled
lazy
localized
mapping-key
mapping-table
name
primary
type

@name Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.

Required


@db-name Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@type Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.

Required


@primary Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@accessor Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@filter-primary Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@entity Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@mapping-key Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@mapping-table Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@id-type Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@id-param Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@convert-null Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@lazy Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@localized Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


@json-enabled Attribute of column

The name value specifies the getter and setter name in the entity.

The type value specifies whether the column is a String, Boolean, or int, etc.

For example:

<column name="companyId" db-name="companyId" type="String" />

The above column specifies that there will be a getter called pojo.getCompanyId() that will return a String.

Set db-name to map the field to a physical database column that is different from the column name.

If the primary value is set to true, then this column is part of the primary key of the entity. If multiple columns have the primary value set to true, then a compound key will be created.

See com.liferay.portal.service.persistence.LayoutPK for an example of a compound primary key.

If the entity and mapping-key attributes are specified and mapping-table is not, then the Service Builder will assume you are specifying a one to many relationship.

For example:

<column name="shoppingItemPrices" type="Collection" entity="ShoppingItemPrice" mapping-key="itemId" />

The above column specifies that there will be a getter called pojo.getShoppingItemPrices() that will return a collection. It will map to a column called itemId in the table that maps to the entity ShoppingItemPrice.

If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.

For example:

<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />

The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.

If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

For example:

<column name="organizations" type="Collection" entity="com.liferay.portal.Organization" mapping-table="Foo_Organizations" />

The id-type and id-param values are used in order to create an auto-generated, auto-incrementing primary key when inserting records into a table. This can be implemented in 4 different ways, depending on the type of database being used. In all cases, the primary key of the model object should be assigned a value of null, and Hibernate will know to replace the null value with an auto-generated, auto-incremented value. If no id-type value is used, it is assumed that the primary key will be assigned and not auto-generated.

The first implementation uses a class to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />

In this implementation, the class specified in the id-param value will be called to retrieve a unique identifier (in the example above, an Integer) that will be used as the primary key for the new record. This implementation works for all supported databases.

The second implementation generates identifiers that are unique only when no other process is inserting data into the same table. This implementation should NOT be used in a clustered environment, but it does work for all supported databases.

For example:

<column name="id" type="Integer" primary="true" id-type="increment" />

The third implementation uses an identity column to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="identity" />

In this implementation, the create table SQL generated for this entity will create an identity column that natively auto-generates a primary key whenever an insert occurs. This implementation is only supported by DB2, MySQL, and MS SQL Server.

The fourth implementation uses a sequence to generate a primary key.

For example:

<column name="id" type="Integer" primary="true" id-type="sequence" id-param="id_sequence" />

In this implementation, a create sequence SQL statement is created based on the id-param value (stored in /sql/sequences.sql). This sequence is then accessed to generate a unique identifier whenever an insert occurs. This implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.

This accessor value specifies whether or not to generate an accessor for this column. This accessor will provide a fast and type-safe way to access column value.

The filter-primary value specifies the column to use as the primary key column when using filter finders. Only one column should ever have this value set to true. If no column has this set to true, then the default primary column be used.

The convert-null value specifies whether or not the column value is automatically converted to a non null value if it is null. This only applies if the type value is String. This is particularly useful if your entity is referencing a read only table or a database view so that Hibernate does not try to issue unnecessary updates. The default value is true.

The lazy value is only valid when type is Blob. It specifies whether or not to do a lazy fetch for Blob. The default value is true.

The localized value specifies whether or not the value of the column can have different values for different locales. The default value is false.

The json-enabled value specifies whether or not the column should be annotated for JSON serialization. By default, if the json-enabled value in the entity element is true, then the json-enabled value in the column element is true.


<order> Child of entity

The order element specifies a default ordering and sorting of the entities when they are retrieved from the database.

<order>'s children
NameCardinality
order-columnAt least one
<order>'s attributes
NameValuesDefault
by
Element's model:

(order-column+)


@by Attribute of order

Set the by attribute to "asc" or "desc" to order by ascending or descending.


<order-column> Child of order

The order-column element allows you to order the entities by specific columns.

<order-column>'s attributes
NameValuesDefault
case-sensitive
name
order-by

@name Attribute of order-column

The attributes of the order-column element allows you to fine tune the ordering of the entity.

For example:

<order by="asc"> <order-column name="parentLayoutId" /> <order-column name="priority" /> </order>

The above settings will order by parentLayoutId and then by priority in an ascending manner.

For example:

<order by="asc"> <order-column name="name" case-sensitive="false" /> </order>

The above settings will order by name and will not be case sensitive.

For example:

<order> <order-column name="articleId" order-by="asc" /> <order-column name="version" order-by="desc" /> </order>

The above settings will order by articleId in an ascending manner and then by version in a descending manner.

Required


@case-sensitive Attribute of order-column

The attributes of the order-column element allows you to fine tune the ordering of the entity.

For example:

<order by="asc"> <order-column name="parentLayoutId" /> <order-column name="priority" /> </order>

The above settings will order by parentLayoutId and then by priority in an ascending manner.

For example:

<order by="asc"> <order-column name="name" case-sensitive="false" /> </order>

The above settings will order by name and will not be case sensitive.

For example:

<order> <order-column name="articleId" order-by="asc" /> <order-column name="version" order-by="desc" /> </order>

The above settings will order by articleId in an ascending manner and then by version in a descending manner.


@order-by Attribute of order-column

The attributes of the order-column element allows you to fine tune the ordering of the entity.

For example:

<order by="asc"> <order-column name="parentLayoutId" /> <order-column name="priority" /> </order>

The above settings will order by parentLayoutId and then by priority in an ascending manner.

For example:

<order by="asc"> <order-column name="name" case-sensitive="false" /> </order>

The above settings will order by name and will not be case sensitive.

For example:

<order> <order-column name="articleId" order-by="asc" /> <order-column name="version" order-by="desc" /> </order>

The above settings will order by articleId in an ascending manner and then by version in a descending manner.


<finder> Child of entity

The finder element represents a generated finder method.

<finder>'s children
NameCardinality
finder-columnAt least one
<finder>'s attributes
NameValuesDefault
db-index
name
return-type
unique
where
Element's model:

(finder-column+)


@name Attribute of finder

The name value specifies the name of the finder method.

The return-type value specifies the return type of the finder. Valid values are "Collection" or the name of the entity. If the value is "Collection", then this finder returns a list of entities. If the value is the name of the entity, then this finder returns at most one entity.

If the unique value is true, then the finder must return a unique entity.

If the db-index value is true, then the service will automatically generate a SQL index for this finder. The default value is true.

Required


@return-type Attribute of finder

The name value specifies the name of the finder method.

The return-type value specifies the return type of the finder. Valid values are "Collection" or the name of the entity. If the value is "Collection", then this finder returns a list of entities. If the value is the name of the entity, then this finder returns at most one entity.

If the unique value is true, then the finder must return a unique entity.

If the db-index value is true, then the service will automatically generate a SQL index for this finder. The default value is true.

Required


@unique Attribute of finder

The name value specifies the name of the finder method.

The return-type value specifies the return type of the finder. Valid values are "Collection" or the name of the entity. If the value is "Collection", then this finder returns a list of entities. If the value is the name of the entity, then this finder returns at most one entity.

If the unique value is true, then the finder must return a unique entity.

If the db-index value is true, then the service will automatically generate a SQL index for this finder. The default value is true.


@where Attribute of finder

The name value specifies the name of the finder method.

The return-type value specifies the return type of the finder. Valid values are "Collection" or the name of the entity. If the value is "Collection", then this finder returns a list of entities. If the value is the name of the entity, then this finder returns at most one entity.

If the unique value is true, then the finder must return a unique entity.

If the db-index value is true, then the service will automatically generate a SQL index for this finder. The default value is true.


@db-index Attribute of finder

The name value specifies the name of the finder method.

The return-type value specifies the return type of the finder. Valid values are "Collection" or the name of the entity. If the value is "Collection", then this finder returns a list of entities. If the value is the name of the entity, then this finder returns at most one entity.

If the unique value is true, then the finder must return a unique entity.

If the db-index value is true, then the service will automatically generate a SQL index for this finder. The default value is true.


<finder-column> Child of finder

The finder-column element specifies the columns to find by.

<finder-column>'s attributes
NameValuesDefault
arrayable-operator
case-sensitive
comparator
name

@name Attribute of finder-column

The name value specifies the name of the finder method.

For example:

<finder name="CompanyId" return-type="Collection"> <finder-column name="companyId" /> </finder>

The above settings will create a finder with the name findByCompanyId that will return a Collection and require a given companyId. It will also generate several more findByCompanyId methods that take in pagination fields (int begin, int end) and more sorting options. The easiest way to understand this is to look at a generated PersistenceImpl class. The Service Builder will also generate removeByCompanyId and countByCompanyId.

See com.liferay.portal.service.persistence.LayoutPersistenceImpl for a good example.

The attribute case-sensitive is a boolean value and is only used if the column is a String value.

The attribute comparator takes in the values =, !=, <, <=, >, >=, or LIKE and is used to compare this column.

The attribute arrayable-operator takes in the values AND or OR and will generate an additional finder where this column's parameter takes an array instead of a single value. Every value in this array will be compared with the column using the comparator, and the conditions will be combined with either an AND or OR operator. For example, a finder column with the = comparator and an arrayable-operator of OR will act like an IN clause.

Required


@case-sensitive Attribute of finder-column

The name value specifies the name of the finder method.

For example:

<finder name="CompanyId" return-type="Collection"> <finder-column name="companyId" /> </finder>

The above settings will create a finder with the name findByCompanyId that will return a Collection and require a given companyId. It will also generate several more findByCompanyId methods that take in pagination fields (int begin, int end) and more sorting options. The easiest way to understand this is to look at a generated PersistenceImpl class. The Service Builder will also generate removeByCompanyId and countByCompanyId.

See com.liferay.portal.service.persistence.LayoutPersistenceImpl for a good example.

The attribute case-sensitive is a boolean value and is only used if the column is a String value.

The attribute comparator takes in the values =, !=, <, <=, >, >=, or LIKE and is used to compare this column.

The attribute arrayable-operator takes in the values AND or OR and will generate an additional finder where this column's parameter takes an array instead of a single value. Every value in this array will be compared with the column using the comparator, and the conditions will be combined with either an AND or OR operator. For example, a finder column with the = comparator and an arrayable-operator of OR will act like an IN clause.


@comparator Attribute of finder-column

The name value specifies the name of the finder method.

For example:

<finder name="CompanyId" return-type="Collection"> <finder-column name="companyId" /> </finder>

The above settings will create a finder with the name findByCompanyId that will return a Collection and require a given companyId. It will also generate several more findByCompanyId methods that take in pagination fields (int begin, int end) and more sorting options. The easiest way to understand this is to look at a generated PersistenceImpl class. The Service Builder will also generate removeByCompanyId and countByCompanyId.

See com.liferay.portal.service.persistence.LayoutPersistenceImpl for a good example.

The attribute case-sensitive is a boolean value and is only used if the column is a String value.

The attribute comparator takes in the values =, !=, <, <=, >, >=, or LIKE and is used to compare this column.

The attribute arrayable-operator takes in the values AND or OR and will generate an additional finder where this column's parameter takes an array instead of a single value. Every value in this array will be compared with the column using the comparator, and the conditions will be combined with either an AND or OR operator. For example, a finder column with the = comparator and an arrayable-operator of OR will act like an IN clause.


@arrayable-operator Attribute of finder-column

The name value specifies the name of the finder method.

For example:

<finder name="CompanyId" return-type="Collection"> <finder-column name="companyId" /> </finder>

The above settings will create a finder with the name findByCompanyId that will return a Collection and require a given companyId. It will also generate several more findByCompanyId methods that take in pagination fields (int begin, int end) and more sorting options. The easiest way to understand this is to look at a generated PersistenceImpl class. The Service Builder will also generate removeByCompanyId and countByCompanyId.

See com.liferay.portal.service.persistence.LayoutPersistenceImpl for a good example.

The attribute case-sensitive is a boolean value and is only used if the column is a String value.

The attribute comparator takes in the values =, !=, <, <=, >, >=, or LIKE and is used to compare this column.

The attribute arrayable-operator takes in the values AND or OR and will generate an additional finder where this column's parameter takes an array instead of a single value. Every value in this array will be compared with the column using the comparator, and the conditions will be combined with either an AND or OR operator. For example, a finder column with the = comparator and an arrayable-operator of OR will act like an IN clause.


<reference> Child of entity

The reference element allows you to inject services from another service.xml within the same class loader. For example, if you inject the Resource entity, then you'll be able to reference the Resource services from your service implementation via the methods getResourceLocalService and getResourceService. You'll also be able to reference the Resource services via the variables resourceLocalService and resourceService.

<reference>'s attributes
NameValuesDefault
entity
package-path

@package-path Attribute of reference

See the comments in reference element.


@entity Attribute of reference

See the comments in reference element.


<tx-required> Child of entity

The tx-required element has a text value that will be used to match method names that require transactions. By default, the methods: add*, check*, clear*, delete*, set*, and update* require propagation of transactions. All other methods support transactions but are assumed to be read only. If you want additional methods to fall under transactions, add the method name to this element.


<exceptions> Child of service-builder

The exceptions element contain a list of generated exceptions. This doesn't save a lot of typing, but can still be helpful.

<exceptions>'s children
NameCardinality
exceptionAny number
Element's model:

(exception*)


<exception> Child of exceptions

See the comments in exceptions element.


<service-builder-import> Child of service-builder

The service-builder-import allows you to split up a large Service Builder file into smaller files by aggregrating the smaller Service Builder into one file. Note that there can be at most one author element among all the files. There can also only be one and only one namespace element among all the files.

The attribute file is interpreted as relative to the file that is importing it.

<service-builder-import>'s attributes
NameValuesDefault
file

@file Attribute of service-builder-import

Set the comments in the service-builder-import element.

Required