Thanks, again, Lukas,

In order to resolve my compiler (Intellij IDEA) complaints I had to make 
some changes.  

One of the bigger changes was that Float became Double and I had to change 
= to .equal()

Here is the result

        SelectConditionStep<Record6<Integer, Integer, Double, Double, Byte, 
Integer>> records = ivDsl.select( sample.SAMPLENO, sample.THRESHID, sample.
V1, sample.V2, adj.TPL, thr.DESCID )
                .from(sample)
                .join(adj).on(adj.THRESHID.eq(sample.THRESHID))
                .join(thr).on(thr.THRESHID.equal(thr.THRESHID))
                .where(sample.SAMPLENO.between(lastDashboardSampleno, 
lastIvSample + 1))
                ;


There is a lot to learn with JOOQ but it is so much better than my 
experience with Hibernate.  Thanks for the time you put into it.

Jim



On Friday, September 19, 2014 2:44:26 AM UTC-4, Jim McGlaughlin wrote:
>
> I am trying to use JOOQ to get data out of three different tables.
>
> In MySql the query would be
>
>            select sample.threshid, sample.sampleno, sample.v1, sample.v2, 
> adj.tpl, thr.DescId
>             from adjthr as adj, adjthrsample as sample, threshold as thr
>             where
>             sample.threshid = adj.threshid
>             and
>             sample.threshid = thr.ThreshId
>
> Using JOOQ I get syntax errors, the closest I come is something like
>
>         Adjthrsample sample = Adjthrsample.ADJTHRSAMPLE;
>         Adjthr       adj    = Adjthr.ADJTHR;
>         Threshold    thr    = Threshold.THRESHOLD;
>
>         Result<Record6<Integer,Integer,Float, Float, Integer, Integer>> 
> records = ivDsl.select( sample.SAMPLENO, sample.THRESHID, sample.V1, 
> sample.V2, adj.TPL, thr.DESCID )
>                 .from( sample )
>                 .join( adj).on( sample.THRESHID = adj.THRESHID)
>                 .join( thr).on( sample.THRESHID = thr.THRESHID)
>                 .where( sample.SAMPLENO.between( startSampleno, 
> lastSampleno +1 ))
>                 .fetch()
>                 ;
>
> From going through the forum and searching only, I don't think I can get a 
> Record6 result from this kind of join, I would get a flat result of all the 
> columns from all the tables.
> If that were the case, I am not sure how I would parse the results.
>
> Not sure if I have the wrong kind of return Result, wrong kind of Select, 
> in addition to just plain bad understanding of JOOQ.  But, I love it.
>
> Any suggested reading or explanation is greatly appreciated.
>
> Jim
>

-- 
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.

Reply via email to