Hi.
How do you do an EntityCondition wherein you need to compare the values of the 2 columns within the entity? Thanks. ~ ian |
are you doing this in a groovy, mini language, or a widget?
ian tabangay sent the following on 11/19/2008 2:44 AM: > Hi. > How do you do an EntityCondition wherein you need to compare the values of > the 2 columns within the entity? > Thanks. > > > ~ ian > |
im doing this in java.
On Wed, Nov 19, 2008 at 6:53 PM, BJ Freeman <[hidden email]> wrote: > are you doing this in a groovy, mini language, or a widget? > |
do a search in code for findList
ian tabangay sent the following on 11/19/2008 3:17 AM: > im doing this in java. > > > On Wed, Nov 19, 2008 at 6:53 PM, BJ Freeman <[hidden email]> wrote: > >> are you doing this in a groovy, mini language, or a widget? >> > |
In reply to this post by ian tabangay
Hello,
I am using Ofbiz revision 691692. Could anyone tell me if Gift Certificate is implemented in that version or maybe in a newer one? Actually, is the service "createGiftCertificate" really used? Any detailed description of using gift certificates would be really appreciated. Best regards, flopa |
In reply to this post by BJ Freeman
i am familiar with findList and how to use EntityConditionList and
EntityExpr. But i am only familiar with comparing a column with a given value (like new EntityExpr("columnName", EntityOperator.EQUALS, value). What i wanted to do is to compare 2 columns of an entity. For example, if it were written as an SQL, it would be something like "SELECT column_a, column_b FROM table WHERE column_a = column_b" On Wed, Nov 19, 2008 at 9:17 PM, BJ Freeman <[hidden email]> wrote: > do a search in code for findList |
One way could be
values = delegator.findList("EntityName", null, null, null, null, true); List field1Values = EntityUtil.getFieldListFromEntityList(values, "field1", true); finalValues = delegator.findList("EntityName", EntityCondition.makeCondition("field2", EntityOperator.IN, field1Values), null, null, null, true); Bilgin On Nov 20, 2008, at 5:01 AM, ian tabangay wrote: > i am familiar with findList and how to use EntityConditionList and > EntityExpr. But i am only familiar with comparing a column with a > given > value (like new EntityExpr("columnName", EntityOperator.EQUALS, > value). What > i wanted to do is to compare 2 columns of an entity. For example, if > it were > written as an SQL, it would be something like "SELECT column_a, > column_b > FROM table WHERE column_a = column_b" > > On Wed, Nov 19, 2008 at 9:17 PM, BJ Freeman <[hidden email]> > wrote: > >> do a search in code for findList |
That's not really very efficient especially if youre trying to find a few
items from a hundred thousand. Putting it in a list would easily give you an OutOfMemoryException. I have a workaround for this but its done using SQLProcessor which could be problematic later on. Any other suggestions? On Thu, Nov 20, 2008 at 6:15 PM, Bilgin Ibryam <[hidden email]> wrote: > One way could be > > values = delegator.findList("EntityName", null, null, null, null, true); > List field1Values = EntityUtil.getFieldListFromEntityList(values, "field1", > true); > finalValues = delegator.findList("EntityName", > EntityCondition.makeCondition("field2", EntityOperator.IN, field1Values), > null, null, null, true); > > Bilgin > > > On Nov 20, 2008, at 5:01 AM, ian tabangay wrote: > > i am familiar with findList and how to use EntityConditionList and >> EntityExpr. But i am only familiar with comparing a column with a given >> value (like new EntityExpr("columnName", EntityOperator.EQUALS, value). >> What >> i wanted to do is to compare 2 columns of an entity. For example, if it >> were >> written as an SQL, it would be something like "SELECT column_a, column_b >> FROM table WHERE column_a = column_b" >> >> On Wed, Nov 19, 2008 at 9:17 PM, BJ Freeman <[hidden email]> wrote: >> >> do a search in code for findList >>> >> > |
I never used the delegator in this purpose. I think it's not possible
and need extend EntityCondition to support this. Nicolas ian tabangay a écrit : > That's not really very efficient especially if youre trying to find a few > items from a hundred thousand. Putting it in a list would easily give you an > OutOfMemoryException. I have a workaround for this but its done using > SQLProcessor which could be problematic later on. Any other suggestions? > > On Thu, Nov 20, 2008 at 6:15 PM, Bilgin Ibryam <[hidden email]> wrote: > > >> One way could be >> >> values = delegator.findList("EntityName", null, null, null, null, true); >> List field1Values = EntityUtil.getFieldListFromEntityList(values, "field1", >> true); >> finalValues = delegator.findList("EntityName", >> EntityCondition.makeCondition("field2", EntityOperator.IN, field1Values), >> null, null, null, true); >> >> Bilgin >> >> >> On Nov 20, 2008, at 5:01 AM, ian tabangay wrote: >> >> i am familiar with findList and how to use EntityConditionList and >> >>> EntityExpr. But i am only familiar with comparing a column with a given >>> value (like new EntityExpr("columnName", EntityOperator.EQUALS, value). >>> What >>> i wanted to do is to compare 2 columns of an entity. For example, if it >>> were >>> written as an SQL, it would be something like "SELECT column_a, column_b >>> FROM table WHERE column_a = column_b" >>> >>> On Wed, Nov 19, 2008 at 9:17 PM, BJ Freeman <[hidden email]> wrote: >>> >>> do a search in code for findList >>> > > -- Nicolas MALIN Consultant Tél : 06.17.66.40.06 Site projet : http://www.neogia.org/ ------- Société LibrenBerry Tél : 02.48.02.56.12 Site : http://www.librenberry.net/ |
In reply to this post by ian tabangay
your other options is to go to the dev mailing list and propose a change
that you are willing to do, that would allow this function. Not saying you will get a positive response, but it is worth a shot. if you get a positive response they will tell you the next step. ian tabangay sent the following on 11/20/2008 4:30 AM: > That's not really very efficient especially if youre trying to find a few > items from a hundred thousand. Putting it in a list would easily give you an > OutOfMemoryException. I have a workaround for this but its done using > SQLProcessor which could be problematic later on. Any other suggestions? > > On Thu, Nov 20, 2008 at 6:15 PM, Bilgin Ibryam <[hidden email]> wrote: > >> One way could be >> >> values = delegator.findList("EntityName", null, null, null, null, true); >> List field1Values = EntityUtil.getFieldListFromEntityList(values, "field1", >> true); >> finalValues = delegator.findList("EntityName", >> EntityCondition.makeCondition("field2", EntityOperator.IN, field1Values), >> null, null, null, true); >> >> Bilgin >> >> >> On Nov 20, 2008, at 5:01 AM, ian tabangay wrote: >> >> i am familiar with findList and how to use EntityConditionList and >>> EntityExpr. But i am only familiar with comparing a column with a given >>> value (like new EntityExpr("columnName", EntityOperator.EQUALS, value). >>> What >>> i wanted to do is to compare 2 columns of an entity. For example, if it >>> were >>> written as an SQL, it would be something like "SELECT column_a, column_b >>> FROM table WHERE column_a = column_b" >>> >>> On Wed, Nov 19, 2008 at 9:17 PM, BJ Freeman <[hidden email]> wrote: >>> >>> do a search in code for findList > |
oh ok. thank you for all who responded.
BJ, would you happen to know why this wasnt implemented? im pretty sure this is not the first time this scenario had been encountered. On Fri, Nov 21, 2008 at 3:26 AM, BJ Freeman <[hidden email]> wrote: > your other options is to go to the dev mailing list and propose a change > that you are willing to do, that would allow this function. > Not saying you will get a positive response, but it is worth a shot. > if you get a positive response they will tell you the next step. > |
Hopefully the people that have done the refactoring will respond.
I have never run across the requirement myself. even in SQL. ian tabangay sent the following on 11/20/2008 7:23 PM: > oh ok. thank you for all who responded. > BJ, would you happen to know why this wasnt implemented? > im pretty sure this is not the first time this scenario had been > encountered. > > > On Fri, Nov 21, 2008 at 3:26 AM, BJ Freeman <[hidden email]> wrote: > >> your other options is to go to the dev mailing list and propose a change >> that you are willing to do, that would allow this function. >> Not saying you will get a positive response, but it is worth a shot. >> if you get a positive response they will tell you the next step. >> > |
I see. thanks.
On Fri, Nov 21, 2008 at 6:06 PM, BJ Freeman <[hidden email]> wrote: > Hopefully the people that have done the refactoring will respond. > I have never run across the requirement myself. > even in SQL. |
In reply to this post by ian tabangay
Hi,
I'm not sure :-\ but I think it's possible with EntityFieldsValues like new EntityExpr("originFacilityId", EntityOperator.EQUALS, new EntityFieldValue("facilityId")); Isn't it ? ian tabangay a écrit : > Hi. > How do you do an EntityCondition wherein you need to compare the values of > the 2 columns within the entity? > Thanks. > > > ~ ian > > |
Yes that did the trick! Thanks alot Charles!
On Fri, Nov 21, 2008 at 10:14 PM, STELTZLEN Charles < [hidden email]> wrote: > Hi, > > I'm not sure :-\ but I think it's possible with EntityFieldsValues like > > new EntityExpr("originFacilityId", EntityOperator.EQUALS, new > EntityFieldValue("facilityId")); > > Isn't it ? |
Free forum by Nabble | Edit this page |