Modifying or Creating Code Generation to provide complete CRUD

57 views
Skip to first unread message

David P

unread,
Nov 22, 2020, 11:58:06 AM11/22/20
to jOOQ User Group
I would like to create a template that would generate the GUI in addition to the database calls. Unfortunately, I don't see instructions or an example of how to.
Can someone let me know where I can find some? I assume it has already been done.

Rob Sargent

unread,
Nov 22, 2020, 2:01:13 PM11/22/20
to jooq...@googlegroups.com
Using what stack, exactly?
CRUD screens are rarely successful UIs

On Nov 22, 2020, at 9:58 AM, David P <oce...@gmail.com> wrote:

I would like to create a template that would generate the GUI in addition to the database calls. Unfortunately, I don't see instructions or an example of how to.
Can someone let me know where I can find some? I assume it has already been done.

--
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 jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/8578e47a-532f-4fee-8957-f80c3135840bn%40googlegroups.com.

David P

unread,
Nov 22, 2020, 2:25:09 PM11/22/20
to jOOQ User Group
I will start with SWING for starters. Then with VAADIN.

Depends on what you mean by a successful UI. If you want a quick and dirty way of navigating through the data, it would do what I need.
I am not looking for a production-ready final product etc. Just a quick viewer and manipulator for in-house.
I know there are other products like ROO or Grail etc, but I did a first try with JOOQ and saw how easy it was to use.
It seems to enable customization but I don't see easy instructions like a "hello world" example.

Rob Sargent

unread,
Nov 22, 2020, 9:27:04 PM11/22/20
to jooq...@googlegroups.com

ok, knock yourself out. :)

In the database realm "hello world" amounts to something like "select 1".  If you're using java that means getting hold of the correct JDBC driver, creating a connection, generating a query, executing the  query and reading the result(s).

Where in the jOO* universe do you see any UI components?  I think its (maniacal?) focus on type-safe data/sql is why many of us like jOOQ so much.

David P

unread,
Nov 22, 2020, 9:34:21 PM11/22/20
to jOOQ User Group
Thanks Rob, but what I would like is some instruction on where the templates are, when are they called/used?

Like examples of how templates are modified or created.

Rob Sargent

unread,
Nov 22, 2020, 9:43:40 PM11/22/20
to jooq...@googlegroups.com

Yeah, sorry.  I don't know to which templates you refer?  Screen/JPanel/label-value generators?

Have you seen what tools like pgAdmin, DBeaver, DbVisualizer can do?

David P

unread,
Nov 23, 2020, 2:28:13 AM11/23/20
to jOOQ User Group

If it is using Velocity or Freemarker I was expecting some files it is using as a template.

For instance, one of my generated files is says

/*
 * This file is generated by jOOQ.
 */
package generated;

I would like to know how it was generated so that I can have it generate more code. That is all I am asking for.

Thank you for your help.

Lukas Eder

unread,
Nov 23, 2020, 3:26:06 AM11/23/20
to jOOQ User Group
We're not using templates to generate code. Most of the logic is in a single Java class, the org.jooq.codegen.JavaGenerator:

Hope this helps,
Lukas

David P

unread,
Nov 23, 2020, 10:41:18 AM11/23/20
to jOOQ User Group
Thank You, that was what I was looking for.

Rob Sargent

unread,
Nov 23, 2020, 4:47:29 PM11/23/20
to jooq...@googlegroups.com

I'm sorry, I didn't understand that OP was planning on writing swing objects as part of code generation.  In this day and age I would be (slightly) more tempted to generate web-ready components, but I stand by my original thesis ;)

David P

unread,
Nov 24, 2020, 1:23:31 AM11/24/20
to jOOQ User Group
I actually agree with you Rob, and I appreciate you letting me know about DBeaver, I always thought Navicat was the only tool to have.

Swing is going to be more of a proof of concept, VAADIN will be the web project.

Also, webswing will allow a swing program to be used on the web but I have not tried it with jdbc calls yet.

Their GUI doesn't seem production-ready but for a quick and dirty project, webswing looks ok.

As far as using JOOQ now, I looked into the file that Lukas mentioned and I see I would have to add sections to it. From what I can see, add my stuff, build it, and use the new jars in my project should do the job.

Rob Sargent

unread,
Nov 24, 2020, 1:36:44 AM11/24/20
to jooq...@googlegroups.com
You probably want to extend that class. I have done so to add fasterxml annotations and package lines. 

On Nov 23, 2020, at 11:23 PM, David P <oce...@gmail.com> wrote:

I actually agree with you Rob, and I appreciate you letting me know about DBeaver, I always thought Navicat was the only tool to have.
Reply all
Reply to author
Forward
0 new messages