ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Dixit <deepak.di...@hotwaxmedia.com>
Subject Re: What is <entity-one> ?
Date Mon, 07 Jan 2013 07:37:17 GMT
You can simply use following pattern :

<entity-one entity-name="DataResource" value-field="currentValue">
            <field-map field-name="dataResourceId" value="STDWRAP001"/>
</entity-one>


Thanks & Regards
-- 
Deepak Dixit


On Jan 7, 2013, at 12:28 PM, Winster Jose wrote:

> Oops.. that was a mistake. I should not have used from-field.
> "default-value" worked for me.
> 
> Thanks anyway.
> 
> 
> On Mon, Jan 7, 2013 at 12:14 PM, Winster Jose <winster@chathurangam.net>wrote:
> 
>> Thanks for the help Atul. The concept is clear to me now.
>> 
>> So I just wanted to test that out. Instead of setting primary key value
>> from parameters, I thought of giving a hard coded value as follows.
>> 
>> <set field="dataResourceId" from-field="STDWRAP001"/>
>> <entity-one entity-name="DataResource" value-field="currentValue"/>
>> <set field="dataResource" from-field="currentValue"/>
>> 
>> where "STDWRAP001" is a valid dataresource id which exists in database.
>> But this is what I get in console.
>> 
>> *PrimaryKeyFinder.java:153:INFO ] Returning null because found incomplete
>> primary key in find: [GenericEntity:DataResource][dataResourceId,null()]*
>> 
>> What went wrong here?
>> 
>> 
>> 
>> On Mon, Jan 7, 2013 at 12:04 PM, Atul Vani <atul.vani@hotwaxmedia.com>wrote:
>> 
>>> Whatever are the primary keys of the entity DataResource, will be
>>> searched in the "context".
>>> 
>>> Why primary keys? because you are using entity-ONE.
>>> 
>>> And the context is where you are setting variables, dataResourceId in
>>> line 1, currentValue in line 2 and dataResource in line 3.
>>> 
>>> 
>>> On Mon, 07 Jan 2013 11:49:20 +0530, Winster Jose <
>>> winster@chathurangam.net> wrote:
>>> 
>>> Hi,
>>>> 
>>>> Can anyone please help me to understand below xml?
>>>> 
>>>> Please correct me if I am wrong. "dataResourceId" is taken from
>>>> parameters
>>>> and set to field "dataResourceId". And DataResource entity is fetched
>>>> (but
>>>> which will act as primary key here?) and set to field "currentValue" and
>>>> later "currentValue" is assigned to another field "dataResource".
>>>> 
>>>> <set field="dataResourceId" from-field="parameters.**dataResourceId"/>
>>>> <entity-one entity-name="DataResource" value-field="currentValue"/>
>>>> <set field="dataResource" from-field="currentValue"/>
>>>> 
>>>> 
>>>> Regards
>>>> Winster T Jose
>>>> Director - Technology and Architecture
>>>> Chathurangam Creative Solutions Private Ltd.
>>>> Cell: +91-98469 31020
>>>> Mail: winster@chathurangam.net
>>>> 
>>> 
>>> 
>>> --
>>> Using Opera's revolutionary email client: http://www.opera.com/mail/
>>> 
>> 
>> 
>> 
>> --
>> Winster T Jose
>> Director - Technology and Architecture
>> Chathurangam Creative Solutions Private Ltd.
>> Cell: +91-98469 31020
>> Mail: winster@chathurangam.net
>> 
> 
> 
> 
> -- 
> Winster T Jose
> Director - Technology and Architecture
> Chathurangam Creative Solutions Private Ltd.
> Cell: +91-98469 31020
> Mail: winster@chathurangam.net


Mime
View raw message