Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Define Service Entities in liferay 6.2

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 314
    Comment on it

    Hello guys,

    Entities are the heart of a service which are defined in the service.xml in the liferay portlet. It represents the map between the model objects in Java and the fields/column and tables in your database. Once your entities are defined in service.xml, the mapping automatically handle by Service Builder.

    For this example, create entity for events. Heres a summary of the information well enter for the Event entity:-

    Name: Event
    Local service: yes
    Remote service: yes

    Below entity example will help to write service in liferay 6.2

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "">
    <service-builder package-path="com">
        <entity name="Event" table="Event" local-service="true" remote-service="true" cache-enabled="true">
            <!-- Primary Key  -->
            <column name="Eventid" type="long" primary="true" />
            <!-- Audit fields -->
            <column name="eventName" type="String" />
            <column name="eventDetails" type="String" />
            <column name="eventDate" type="Date" />
            <!-- Order by  -->
            <order by="asc">
                <order-column name="eventDate" />

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: