Hi Prabhakar,

You should have service engine utility.
In OFBiz for CRUD operation we use services. You can write service using 
entity-auto.
Please refer example/services.xml for more reference.

<service name="createExample" default-entity-name="Example" 
engine="entity-auto" invoke="create" auth="true">


Thanks & Regards
-- 
Deepak Dixit
HotWax Media Pvt. Ltd.
www.hotwaxmedia.com
Contact :- +91-98267-54548
Skype  :- deepakdixit

On Jul 13, 2012, at 10:47 AM, Prabhakar Pandey wrote:

> Hello,
> 
> This is my entitymodel.xml file
> 
> <entity entity-name="Employee" package-name="org.ofbiz.hello1" title="Hello
> Person Entity">
> 
>      <field name="empId" type="id-ne" ></field>
>      <field name="firstName" type="name"></field>
>      <field name="lastName" type="name"></field>
>      <field name="email" type="name"></field>
>      <prim-key field="empId"/>
>    </entity>
> 
> This is part of EmployeeServices,java
> 
> GenericValue employee = delegator.makeValue("Employee");
>    employee.put("empId",12);
>    employee.put("firstName",firstName);
>        employee.put("lastName", lastName);
>        employee.put("email", email);
> 
> 
> when i am giving hard coded value for empId then its getting stored in DB.
> i want to autoassign that field so that i don't have to hard-code the value
> again and again ... Any help on this?
> Thanks in advance!

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to