Filter a JOOQ generated table with a condition while maintaining type Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live! The [wrap] tag is in the process of being burninatedSQL query return data from multiple tablesFilter Table Before Applying Left JoinJOOQ class generation and gradleGenerating multiple java Enums from a single table, using JOOQExtending a JOOQ Table classJOOQ: how do I add an interface to a generated Record ClassjOOQ: Code generation with mavenJOOQ & Firebird - Implementation Limit ExceededHow can I reduce the number of interface methods in this generic jOOQ queryJOOQ: Logically group columns from different tables in common interface

How do I make this wiring inside cabinet safer? (Pic)

Why aren't air breathing engines used as small first stages

Where are Serre’s lectures at Collège de France to be found?

What do you call the main part of a joke?

What causes the direction of lightning flashes?

Is there any way for the UK Prime Minister to make a motion directly dependent on Government confidence?

What does "lightly crushed" mean for cardamon pods?

Extracting terms with certain heads in a function

Is it cost-effective to upgrade an old-ish Giant Escape R3 commuter bike with entry-level branded parts (wheels, drivetrain)?

Why wasn't DOSKEY integrated with COMMAND.COM?

Did MS DOS itself ever use blinking text?

Irreducible of finite Krull dimension implies quasi-compact?

Can anything be seen from the center of the Boötes void? How dark would it be?

Do I really need recursive chmod to restrict access to a folder?

Is safe to use va_start macro with this as parameter?

On SQL Server, is it possible to restrict certain users from using certain functions, operators or statements?

Using et al. for a last / senior author rather than for a first author

Maximum summed powersets with non-adjacent items

How to answer "Have you ever been terminated?"

Does classifying an integer as a discrete log require it be part of a multiplicative group?

Crossing US/Canada Border for less than 24 hours

Can you use the Shield Master feat to shove someone before you make an attack by using a Readied action?

Most bit efficient text communication method?

Circuit to "zoom in" on mV fluctuations of a DC signal?



Filter a JOOQ generated table with a condition while maintaining type



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!
The [wrap] tag is in the process of being burninatedSQL query return data from multiple tablesFilter Table Before Applying Left JoinJOOQ class generation and gradleGenerating multiple java Enums from a single table, using JOOQExtending a JOOQ Table classJOOQ: how do I add an interface to a generated Record ClassjOOQ: Code generation with mavenJOOQ & Firebird - Implementation Limit ExceededHow can I reduce the number of interface methods in this generic jOOQ queryJOOQ: Logically group columns from different tables in common interface



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















I have generated a number of JOOQ classes from my database. I want to easily filter my tables by customer while maintaining the strong type of my tables.



This is what I want to be able to do:



// Generated class books
JBooks books = JBooks.BOOKS;

// get ownershipCheck (this could be more complicated, possibly joining multiple tables)
Condition ownershipCheck = books.customer().ID.eq(currentCustomer);

// desired output that I can do further operations on
JBooks filteredBooks = selectFrom(books).where(ownershipCheck).asTable();


// a bunch of random operations using the functionality from JBooks
db.select(filteredBooks.AUTHOR, filteredBooks.PUBLISH_DATE, ...etc)



Unfortunately, I can't do this. I get a Table<JSubscriberUsageCdrRecord> instead and I see no way to cast my new Table to JBooks










share|improve this question






























    2















    I have generated a number of JOOQ classes from my database. I want to easily filter my tables by customer while maintaining the strong type of my tables.



    This is what I want to be able to do:



    // Generated class books
    JBooks books = JBooks.BOOKS;

    // get ownershipCheck (this could be more complicated, possibly joining multiple tables)
    Condition ownershipCheck = books.customer().ID.eq(currentCustomer);

    // desired output that I can do further operations on
    JBooks filteredBooks = selectFrom(books).where(ownershipCheck).asTable();


    // a bunch of random operations using the functionality from JBooks
    db.select(filteredBooks.AUTHOR, filteredBooks.PUBLISH_DATE, ...etc)



    Unfortunately, I can't do this. I get a Table<JSubscriberUsageCdrRecord> instead and I see no way to cast my new Table to JBooks










    share|improve this question


























      2












      2








      2








      I have generated a number of JOOQ classes from my database. I want to easily filter my tables by customer while maintaining the strong type of my tables.



      This is what I want to be able to do:



      // Generated class books
      JBooks books = JBooks.BOOKS;

      // get ownershipCheck (this could be more complicated, possibly joining multiple tables)
      Condition ownershipCheck = books.customer().ID.eq(currentCustomer);

      // desired output that I can do further operations on
      JBooks filteredBooks = selectFrom(books).where(ownershipCheck).asTable();


      // a bunch of random operations using the functionality from JBooks
      db.select(filteredBooks.AUTHOR, filteredBooks.PUBLISH_DATE, ...etc)



      Unfortunately, I can't do this. I get a Table<JSubscriberUsageCdrRecord> instead and I see no way to cast my new Table to JBooks










      share|improve this question
















      I have generated a number of JOOQ classes from my database. I want to easily filter my tables by customer while maintaining the strong type of my tables.



      This is what I want to be able to do:



      // Generated class books
      JBooks books = JBooks.BOOKS;

      // get ownershipCheck (this could be more complicated, possibly joining multiple tables)
      Condition ownershipCheck = books.customer().ID.eq(currentCustomer);

      // desired output that I can do further operations on
      JBooks filteredBooks = selectFrom(books).where(ownershipCheck).asTable();


      // a bunch of random operations using the functionality from JBooks
      db.select(filteredBooks.AUTHOR, filteredBooks.PUBLISH_DATE, ...etc)



      Unfortunately, I can't do this. I get a Table<JSubscriberUsageCdrRecord> instead and I see no way to cast my new Table to JBooks







      java sql jooq






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 11 at 16:59









      Lukas Eder

      138k74448987




      138k74448987










      asked Mar 8 at 18:51









      hwaringhwaring

      134




      134






















          1 Answer
          1






          active

          oldest

          votes


















          0














          This is being worked on through:




          • #8012 "Override Table.where(Condition) methods in generated tables"


          • #1969 "Add support for views expressed in jOOQ"

          In short, a table can accept a predicate and the result is a modified table of the same table type, exposing the same type safe column expressions. In generated SQL, this can either produce a derived table or be inlined into the calling SQL statement.



          As of jOOQ 3.11, these features are not yet available.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069306%2ffilter-a-jooq-generated-table-with-a-condition-while-maintaining-type%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            This is being worked on through:




            • #8012 "Override Table.where(Condition) methods in generated tables"


            • #1969 "Add support for views expressed in jOOQ"

            In short, a table can accept a predicate and the result is a modified table of the same table type, exposing the same type safe column expressions. In generated SQL, this can either produce a derived table or be inlined into the calling SQL statement.



            As of jOOQ 3.11, these features are not yet available.






            share|improve this answer



























              0














              This is being worked on through:




              • #8012 "Override Table.where(Condition) methods in generated tables"


              • #1969 "Add support for views expressed in jOOQ"

              In short, a table can accept a predicate and the result is a modified table of the same table type, exposing the same type safe column expressions. In generated SQL, this can either produce a derived table or be inlined into the calling SQL statement.



              As of jOOQ 3.11, these features are not yet available.






              share|improve this answer

























                0












                0








                0







                This is being worked on through:




                • #8012 "Override Table.where(Condition) methods in generated tables"


                • #1969 "Add support for views expressed in jOOQ"

                In short, a table can accept a predicate and the result is a modified table of the same table type, exposing the same type safe column expressions. In generated SQL, this can either produce a derived table or be inlined into the calling SQL statement.



                As of jOOQ 3.11, these features are not yet available.






                share|improve this answer













                This is being worked on through:




                • #8012 "Override Table.where(Condition) methods in generated tables"


                • #1969 "Add support for views expressed in jOOQ"

                In short, a table can accept a predicate and the result is a modified table of the same table type, exposing the same type safe column expressions. In generated SQL, this can either produce a derived table or be inlined into the calling SQL statement.



                As of jOOQ 3.11, these features are not yet available.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 12 at 16:40









                Lukas EderLukas Eder

                138k74448987




                138k74448987





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069306%2ffilter-a-jooq-generated-table-with-a-condition-while-maintaining-type%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

                    Алба-Юлія

                    Захаров Федір Захарович