Reader small image

You're reading from  jOOQ Masterclass

Product typeBook
Published inAug 2022
Reading LevelBeginner
PublisherPackt
ISBN-139781800566897
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Anghel Leonard
Anghel Leonard
author image
Anghel Leonard

Anghel Leonard is a Chief Technology Strategist and independent consultant with 20+ years of experience in the Java ecosystem. In daily work, he is focused on architecting and developing Java distributed applications that empower robust architectures, clean code, and high-performance. Also passionate about coaching, mentoring and technical leadership. He is the author of several books, videos and dozens of articles related to Java technologies.
Read more about Anghel Leonard

Right arrow

Generating code for two schemas of the same vendor

Consider two schemas of the same vendor named db1 and db2. In the first schema (db1), we have a table named productline, and in the second schema (db2), we have a table named product. Our goal is to generate the jOOQ artifacts (to run the jOOQ Code Generator) for these two schemas of the same vendor (here, MySQL) and to execute queries against one or another, and even join these two tables.

Basically, as long as we don't specify any input schema, jOOQ generates code for all the schemas it can find. But since we want to instruct jOOQ to work only on the db1 and db2 schemas, we can do it as follows (here, for Maven):

<database>
 <schemata>
   <schema>
    <inputSchema>db1</inputSchema>
   </schema>
   <schema>
    <inputSchema>db2</inputSchema>
   </schema>
 </schemata...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
jOOQ Masterclass
Published in: Aug 2022Publisher: PacktISBN-13: 9781800566897

Author (1)

author image
Anghel Leonard

Anghel Leonard is a Chief Technology Strategist and independent consultant with 20+ years of experience in the Java ecosystem. In daily work, he is focused on architecting and developing Java distributed applications that empower robust architectures, clean code, and high-performance. Also passionate about coaching, mentoring and technical leadership. He is the author of several books, videos and dozens of articles related to Java technologies.
Read more about Anghel Leonard