Skip to content

aeisele/jooqdepluralizestrategy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jooq depluralize naming strategy

Why?

Some people prefer table names to be in pluralized form which can lead to semantically strange code when using jooq codegen for POJOs and DAOs.

Customers customer = CustomersDao.fetchOneById(4711);

This strategy can be used to turn plural table terms into singular terms for code generation

Customer customer = CustomersDao.fetchOneById(4711);

How

Add a plugin repository to use jitpack.io

<pluginRepository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</pluginRepository>

Add dependency to this artifact to your jooq maven plugin config

<plugin>
    <groupId>org.jooq</groupId>
    <artifactId>jooq-codegen-maven</artifactId>
    ...
    <dependencies>
        <dependency>
            <groupId>com.github.aeisele</groupId>
            <artifactId>jooqdepluralizestrategy</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>
    <configuration>
        ...
        <generator>
            <strategy>
                <name>com.andreaseisele.jooq.strategy.DepluralizeNamingStrategy</name>
            </strategy>
        ...
        </generator>
    </configuration>
</plugin>

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages