Hi Simone,

Good question. *I'm curious about best practices / ideas from other users
on this group. Feel free to share!*

There isn't really anything "official" that I would suggest as a naming
standard with jOOQ. From my experience, jOOQ shouldn't influence / impact
your decisions in any way, as jOOQ can deal with any naming standards,
including case-sensitivity and special characters (although these might
cause 1-2 code generator bugs, if abused excessively).

In the past, these rules have helped me organise tables and views, though:

- Tables and views had prefixes indicating their "nature". These were
mainly:
    - data tables
    - master data tables
    - system tables
    - temporary tables
    - views
- Tables had no grants on them
- Some views had grants on them
- Views had suffixes indicating what kinds of grants and check options they
have. These were mainly:
    - read-only views
    - updatable views
    - user views (read-only and writable)
    - admin views (read-only and writable)
    - backend views (read-only and writable)
    - utility views (no grants)
- User views implemented ACLs, which is why there were no grants on tables:
To avoid unauthorised data access at a SQL level
- View columns used well-defined 4-letter acronym prefixes describing the
table they came from. This is crucial for many reasons:
    - optimisation (e.g. making use of explicit predicate push-down hints
in Oracle)
    - optimisation (e.g. calculated columns can be recognised easily, and
avoided in predicates)
    - disambiguation (e.g. ABCD_ID vs. OPQR_ID. Collisions are impossible)
- Table columns used the same 4-letter acronym prefixes for foreign keys
(e.g. XX.ABCD_ID references AAA_B_CCCC_D.ID)
- Indexes and constraints reused the above 4-letter acronyms for improved
readability

Of course, you may have entirely different requirements, where the above
rules are not suitable / applicable.

Cheers
Lukas


2013/3/6 Simone Giacomelli <[email protected]>

> Hi,
>   I'm going to use jooq for a project.
>
> Any advice regarding the naming of tables and fields in the database would
> be appreciated :)
> Do you follow/suggest any naming standard with jooq? Or apart from jooq?
>
> thanks for your help
> Simone
>
> --
> 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/groups/opt_out.
>
>
>

-- 
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/groups/opt_out.


Reply via email to