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