Prabhakar,

Use GenericDelegator class methods for doing so.
Not sure if you go thru the practice application tutorial -
https://cwiki.apache.org/OFBIZ/ofbiz-tutorial-a-beginners-development-guide.html

--
Rishi Solanki


On Fri, Jul 13, 2012 at 11:54 AM, Prabhakar Pandey <[email protected]>wrote:

> Also it would be great if any1 could tell me how can i retrieve values from
> database using Java services and events only.
>
>
> On Fri, Jul 13, 2012 at 11:02 AM, Deepak Dixit <
> [email protected]
> > wrote:
>
> > 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!
> >
> >
>

Reply via email to