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: [hidden email] |
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 <[hidden email]> 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: [hidden email] -- Using Opera's revolutionary email client: http://www.opera.com/mail/ |
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 <[hidden email]>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 <[hidden email]> > 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: [hidden email] >> > > > -- > 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: [hidden email] |
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 <[hidden email]>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 <[hidden email]>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 < >> [hidden email]> 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: [hidden email] >>> >> >> >> -- >> 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: [hidden email] > -- Winster T Jose Director - Technology and Architecture Chathurangam Creative Solutions Private Ltd. Cell: +91-98469 31020 Mail: [hidden email] |
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 <[hidden email]>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 <[hidden email]>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 < >>> [hidden email]> 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: [hidden email] >>>> >>> >>> >>> -- >>> 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: [hidden email] >> > > > > -- > Winster T Jose > Director - Technology and Architecture > Chathurangam Creative Solutions Private Ltd. > Cell: +91-98469 31020 > Mail: [hidden email] smime.p7s (6K) Download Attachment |
Thanks Deepak. That is better.
On Mon, Jan 7, 2013 at 1:07 PM, Deepak Dixit <[hidden email]>wrote: > 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 <[hidden email] > >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 <[hidden email] > >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 < > >>> [hidden email]> 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: [hidden email] > >>>> > >>> > >>> > >>> -- > >>> 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: [hidden email] > >> > > > > > > > > -- > > Winster T Jose > > Director - Technology and Architecture > > Chathurangam Creative Solutions Private Ltd. > > Cell: +91-98469 31020 > > Mail: [hidden email] > > -- Winster T Jose Director - Technology and Architecture Chathurangam Creative Solutions Private Ltd. Cell: +91-98469 31020 Mail: [hidden email] |
In reply to this post by Winster
Jose,
Please take some time to understand the Mini-language grammar: https://cwiki.apache.org/OFBADMIN/mini-language-reference.html The statement <set field="dataResourceId" from-field="STDWRAP001"/> is saying "set the contents of the dataResourceId variable to the value contained in the STDWRAP001 variable." I don't think that is what you want. I think you want this: <set field="dataResourceId" value="STDWRAP001"/> which says "set the contents of the dataResourceId variable to the constant 'STDWRAP001'." -Adrian On 1/7/2013 6:44 AM, Winster Jose 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 <[hidden email]>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 <[hidden email]> >> 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: [hidden email] >>> >> >> -- >> Using Opera's revolutionary email client: http://www.opera.com/mail/ >> > > |
Thanks Adrian.
On 8 Jan 2013 01:38, "Adrian Crum" <[hidden email]> wrote: > Jose, > > Please take some time to understand the Mini-language grammar: > > https://cwiki.apache.org/**OFBADMIN/mini-language-**reference.html<https://cwiki.apache.org/OFBADMIN/mini-language-reference.html> > > The statement > > <set field="dataResourceId" from-field="STDWRAP001"/> > > > is saying "set the contents of the dataResourceId variable to the value > contained in the STDWRAP001 variable." I don't think that is what you want. > I think you want this: > > <set field="dataResourceId" value="STDWRAP001"/> > > > which says "set the contents of the dataResourceId variable to the > constant 'STDWRAP001'." > > -Adrian > > On 1/7/2013 6:44 AM, Winster Jose 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 <[hidden email]>** >> 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 < >>> [hidden email]> >>> 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: [hidden email] >>>> >>>> >>> -- >>> Using Opera's revolutionary email client: http://www.opera.com/mail/ >>> >>> >> >> > |
Free forum by Nabble | Edit this page |