Also, trying to do something like: Result<Record3<Field<String>, Field<String>, Field<String>>> result = create.newResult(******WHAT DO I PUT HERE******);
That's problematic as well... Deven On Monday, June 16, 2014 2:31:01 PM UTC-4, Deven Phillips wrote: > > OK, I can follow that, but how do I create an instance of type "Field" > with a name "vdc" and type of "String"? So far, I just see that I would > have to create an anonymous implementation of the Field interface and > implement all of the methods... Is there a better way? > > Thanks in advance and thanks for the fast replies!! > > Deven > > On Monday, June 16, 2014 2:28:52 PM UTC-4, Lukas Eder wrote: >> >> You have to provide a value for a field whose name is "vdc". >> >> I understand the source of confusion now, though. You're creating a >> Result<CustomerRecord>, when you really want to create a >> Result<Record3<String, String, String>> for this very specific query. >> >> Use DSLContext.newRecord(Field, Field, Field) >> <http://www.jooq.org/javadoc/latest/org/jooq/DSLContext.html#newRecord(org.jooq.Field,+org.jooq.Field,+org.jooq.Field)> >> >> to construct such records. >> >> >> 2014-06-16 20:24 GMT+02:00 Deven Phillips <[email protected]>: >> >>> Lukas, >>> >>> Yes, and in other iterations I have done that like: >>> >>> result.get(0).setValue(CUSTOMER.NAME <http://customer.name/>.as("name"), >>> "John Doe"); >>> >>> But that still doesn't answer my real question of how to handle the >>> calculated field? Or did I not understand you completely? >>> >>> Thanks, >>> >>> Deven >>> >>> On Monday, June 16, 2014 2:22:35 PM UTC-4, Lukas Eder wrote: >>> >>>> When you select "name", "code" and "vdc", you will also have to provide >>>> values for exactly the same fields, e.g. fieldByName("name"), >>>> fieldByName("code"), etc... Field identifiers are case-sensitive in jOOQ. >>>> >>>> >>>> 2014-06-16 20:11 GMT+02:00 Deven Phillips <[email protected]>: >>>> >>>>> I saw this: >>>>> >>>>> https://groups.google.com/d/msg/jooq-user/C2LpNFUewdk/7RINa5ZDKBIJ >>>>> >>>>> and the related issue: >>>>> >>>>> https://github.com/jOOQ/jOOQ/issues/3139 >>>>> >>>>> But I don't think it addresses the question I have... >>>>> >>>>> >>>>> I am creating a query: >>>>> >>>>> create.select( >>>>> CUSTOMER.NAME.as("name"), >>>>> CUSTOMER.CODE.as("code"), >>>>> concat(val("/v3/customer/"), CUSTOMER.CODE, >>>>> val("/vdc")).as("vdc")) >>>>> .where(CUSTOMER.CODE.eq(code)); >>>>> >>>>> When I create a MockDataProvider, I can use CUSTOMER.CODE and >>>>> CUSTOMER.NAME as field identifiers, but how do I identify the >>>>> calculated field in the MockDataProvider? >>>>> >>>>> E.g.: >>>>> >>>>> Result<CustomerRecord> result = create.newResult(CUSTOMER); >>>>> result.add(create.newRecord(CUSTOMER)); >>>>> result.get(0).setValue(CUSTOMER.NAME, "John Doe"); >>>>> result.get(0).setValue(CUSTOMER.CODE, "29793408"); >>>>> result.get(0).setValue(******What can I put here?!?!******, >>>>> "/v3/customer/29793408/vdc"); >>>>> >>>>> Any help would be greatly appreciated!! >>>>> >>>>> Deven >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "jOOQ User Group" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "jOOQ User Group" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
