Hello Adithi,
Ofbiz best practice for performing CRUD operations is to write services and yes we can use Groovy for creating, updating ,retrieving and deleting data i.e for data preparation.Using Groovy we can get data from the database on the fly.
---
Thanks  and Regards
Surya Kusumakar
HotwaxMedia Pvt Ltd.
www.hotwaxmedia.com


Divesh Dutta wrote:
<service name="createExample" default-entity-name="Example" engine="entity-auto" invoke="create" auth="true">
       <description>Create a Example</description>
<permission-service service-name="exampleGenericPermission" main-action="CREATE"/>
       <auto-attributes include="pk" mode="OUT" optional="false"/>
       <auto-attributes include="nonpk" mode="IN" optional="true"/>
       <override name="exampleTypeId" optional="false"/>
       <override name="statusId" optional="false"/>
       <override name="exampleName" optional="false"/>
   </service>

1)This is service definition.you dont need override tag here.if you implement any interface just like when we implement any class in java,then you need override tag.

2)engine="entity-auto":: reason for using this tag is given below in this link: http://www.nabble.com/The-fancy-new-entity-auto-service-execution-engine-td18674040.html

3)engine="entity-auto" invoke="create" play the role for creating the records for the default-entity "Example."

4)  <auto-attributes include="pk" mode="OUT" optional="false"/>
   <auto-attributes include="nonpk" mode="IN" optional="true"/>
This tag automatically includes primary key and non primary key of default-entity-name="Example"
   Additional tags can be added by:
<attribute name="firstName" mode="IN" type="String" optional="false"/>
5)<auto-attributes tag are used only in service definition.

6)Please refer to practice application.I have already given you the link.most of the answer of your question are given over there.


Thanks And Regards

Divesh Dutta

Hotwax Media Pvt Ltd.















Reply via email to