You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Hemanth Kumar Kanamarlapudi <he...@mindtree.com> on 2009/12/30 06:19:37 UTC

How to create a new entity

Hi All,

I have added a new entity definition in an existing entitymodel.xml which is already loaded through ofbiz-component.xml


<entity entity-name="trackUserSource" package-name="com.pj.contact"
            title="Track User Source Entity" >
            <field name="trackId" type="id-ne"/>
            <field name="source" type="long-varchar"/>
            <field name="medium" type="long-varchar"/>
            <field name="campaign" type="long-varchar"/>
            <field name="userId" type="long-varchar"/>
            <field name="pid" type="long-varchar"/>
            <prim-key field="trackId"/>
</entity>

But I am not able to create this object when I restart ofbiz.

Your quick help is appreciated.

Thanks & Regards
Hemanth



________________________________
http://www.mindtree.com/email/disclaimer.html

Re: How to create a new entity

Posted by Abdullah Shaikh <ab...@gmail.com>.
Restarting should also work if add-missing-on-start="true" in
entityengine.xml

- Abdullah

On Wed, Dec 30, 2009 at 10:41 AM, Divesh Dutta <divesh.dutta@hotwaxmedia.com
> wrote:

> Hi Hemanth,
>
> Restarting the OFBiz will not solve your purpose. ant run-install will be
> your friend, in that case.
>
> Thanks
> --
> Divesh Dutta.
>
>
> Hemanth Kumar Kanamarlapudi wrote:
>
>> Hi All,
>>
>> I have added a new entity definition in an existing entitymodel.xml which
>> is already loaded through ofbiz-component.xml
>>
>>
>> <entity entity-name="trackUserSource" package-name="com.pj.contact"
>>            title="Track User Source Entity" >
>>            <field name="trackId" type="id-ne"/>
>>            <field name="source" type="long-varchar"/>
>>            <field name="medium" type="long-varchar"/>
>>            <field name="campaign" type="long-varchar"/>
>>            <field name="userId" type="long-varchar"/>
>>            <field name="pid" type="long-varchar"/>
>>            <prim-key field="trackId"/>
>> </entity>
>>
>> But I am not able to create this object when I restart ofbiz.
>>
>> Your quick help is appreciated.
>>
>> Thanks & Regards
>> Hemanth
>>
>>
>>
>> ________________________________
>> http://www.mindtree.com/email/disclaimer.html
>>
>>
>>
>
>

Re: How to create a new entity

Posted by Divesh Dutta <di...@hotwaxmedia.com>.
Yes exactly, It depends on case to case, What to use when.

Thanks
--
Divesh Dutta.


Hemanth Kumar Kanamarlapudi wrote:
> Hi All,
>
> I have tried in another developer system and it worked well. I need to figure out the problem in my local environment.
> For your information,
> We should not use run-install because it will override all the new changes done in the db.
>
> Hi Priya,
> Thanks for helping out.
>
> Regards
> Hemanth
>
>
> -----Original Message-----
> From: Divesh Dutta [mailto:divesh.dutta@hotwaxmedia.com] 
> Sent: Wednesday, December 30, 2009 10:41 AM
> To: user@ofbiz.apache.org
> Subject: Re: How to create a new entity
>
> Hi Hemanth,
>
> Restarting the OFBiz will not solve your purpose. ant run-install will 
> be your friend, in that case.
>
> Thanks
> --
> Divesh Dutta.
>
> Hemanth Kumar Kanamarlapudi wrote:
>   
>> Hi All,
>>
>> I have added a new entity definition in an existing entitymodel.xml which is already loaded through ofbiz-component.xml
>>
>>
>> <entity entity-name="trackUserSource" package-name="com.pj.contact"
>>             title="Track User Source Entity" >
>>             <field name="trackId" type="id-ne"/>
>>             <field name="source" type="long-varchar"/>
>>             <field name="medium" type="long-varchar"/>
>>             <field name="campaign" type="long-varchar"/>
>>             <field name="userId" type="long-varchar"/>
>>             <field name="pid" type="long-varchar"/>
>>             <prim-key field="trackId"/>
>> </entity>
>>
>> But I am not able to create this object when I restart ofbiz.
>>
>> Your quick help is appreciated.
>>
>> Thanks & Regards
>> Hemanth
>>
>>
>>
>> ________________________________
>> http://www.mindtree.com/email/disclaimer.html
>>
>>   
>>     
>
>   


RE: How to create a new entity

Posted by Hemanth Kumar Kanamarlapudi <he...@mindtree.com>.
Hi All,

I have tried in another developer system and it worked well. I need to figure out the problem in my local environment.
For your information,
We should not use run-install because it will override all the new changes done in the db.

Hi Priya,
Thanks for helping out.

Regards
Hemanth


-----Original Message-----
From: Divesh Dutta [mailto:divesh.dutta@hotwaxmedia.com] 
Sent: Wednesday, December 30, 2009 10:41 AM
To: user@ofbiz.apache.org
Subject: Re: How to create a new entity

Hi Hemanth,

Restarting the OFBiz will not solve your purpose. ant run-install will 
be your friend, in that case.

Thanks
--
Divesh Dutta.

Hemanth Kumar Kanamarlapudi wrote:
> Hi All,
>
> I have added a new entity definition in an existing entitymodel.xml which is already loaded through ofbiz-component.xml
>
>
> <entity entity-name="trackUserSource" package-name="com.pj.contact"
>             title="Track User Source Entity" >
>             <field name="trackId" type="id-ne"/>
>             <field name="source" type="long-varchar"/>
>             <field name="medium" type="long-varchar"/>
>             <field name="campaign" type="long-varchar"/>
>             <field name="userId" type="long-varchar"/>
>             <field name="pid" type="long-varchar"/>
>             <prim-key field="trackId"/>
> </entity>
>
> But I am not able to create this object when I restart ofbiz.
>
> Your quick help is appreciated.
>
> Thanks & Regards
> Hemanth
>
>
>
> ________________________________
> http://www.mindtree.com/email/disclaimer.html
>
>   


Re: How to create a new entity

Posted by Divesh Dutta <di...@hotwaxmedia.com>.
Hi Hemanth,

Restarting the OFBiz will not solve your purpose. ant run-install will 
be your friend, in that case.

Thanks
--
Divesh Dutta.

Hemanth Kumar Kanamarlapudi wrote:
> Hi All,
>
> I have added a new entity definition in an existing entitymodel.xml which is already loaded through ofbiz-component.xml
>
>
> <entity entity-name="trackUserSource" package-name="com.pj.contact"
>             title="Track User Source Entity" >
>             <field name="trackId" type="id-ne"/>
>             <field name="source" type="long-varchar"/>
>             <field name="medium" type="long-varchar"/>
>             <field name="campaign" type="long-varchar"/>
>             <field name="userId" type="long-varchar"/>
>             <field name="pid" type="long-varchar"/>
>             <prim-key field="trackId"/>
> </entity>
>
> But I am not able to create this object when I restart ofbiz.
>
> Your quick help is appreciated.
>
> Thanks & Regards
> Hemanth
>
>
>
> ________________________________
> http://www.mindtree.com/email/disclaimer.html
>
>   


Re: How to create a new entity

Posted by David E Jones <de...@me.com>.
On Dec 30, 2009, at 8:54 AM, Brett Palmer wrote:

> 2. Then add the entity to the group file which is usually called
> entitygroup.xml
> <entity-group group="org.ofbiz" entity="TrackUserSource" />

In the release09.04 branch and the trunk this is no longer necessary if you want the entity to be in the default group for the delegator.

-David


Re: How to create a new entity

Posted by Brett Palmer <br...@gmail.com>.
There are two steps to definining a new entity.

1. First add the entity definition to your entitymodel.xml file which looks
you have.

2. Then add the entity to the group file which is usually called
entitygroup.xml
<entity-group group=*"org.ofbiz"* entity=*"TrackUserSource"* />


If you don't have the entity added to the entitygroup.xml file it won't be
created when the server starts up.

I noticed you named your entity trackUserSource.  The standard naming
convention is to start with upper case name for the entity (e.g.
TrackUserSource).


Hope that helps.


Brett
On Tue, Dec 29, 2009 at 10:19 PM, Hemanth Kumar Kanamarlapudi <
hemanth_kanamarlapudi@mindtree.com> wrote:

> Hi All,
>
> I have added a new entity definition in an existing entitymodel.xml which
> is already loaded through ofbiz-component.xml
>
>
> <entity entity-name="trackUserSource" package-name="com.pj.contact"
>            title="Track User Source Entity" >
>            <field name="trackId" type="id-ne"/>
>            <field name="source" type="long-varchar"/>
>            <field name="medium" type="long-varchar"/>
>            <field name="campaign" type="long-varchar"/>
>            <field name="userId" type="long-varchar"/>
>            <field name="pid" type="long-varchar"/>
>            <prim-key field="trackId"/>
> </entity>
>
> But I am not able to create this object when I restart ofbiz.
>
> Your quick help is appreciated.
>
> Thanks & Regards
> Hemanth
>
>
>
> ________________________________
> http://www.mindtree.com/email/disclaimer.html
>