Created
October 8, 2015 15:40
-
-
Save michael-simons/f0b371342c4b3ebe1b55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.enerko.ensupply.config; | |
import org.jooq.ConnectionProvider; | |
import org.jooq.ExecuteListenerProvider; | |
import org.jooq.SQLDialect; | |
import org.jooq.TransactionProvider; | |
import org.jooq.impl.DefaultConfiguration; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.jooq.RecordMapperProvider; | |
import org.jooq.conf.RenderKeywordStyle; | |
import org.jooq.conf.RenderNameStyle; | |
import org.springframework.beans.factory.annotation.Value; | |
/** | |
* @author Michael J. Simons | |
*/ | |
@Configuration | |
public class JooqSpringBootConfig { | |
@Bean | |
public org.jooq.Configuration jooqConfig( | |
ConnectionProvider connectionProvider, | |
TransactionProvider transactionProvider, | |
ExecuteListenerProvider executeListenerProvider, | |
RecordMapperProvider recordMapperProvider, | |
@Value("${jooq.renderFormatted:false}") boolean renderFormatted | |
) { | |
final DefaultConfiguration hlp = new DefaultConfiguration(); | |
return hlp | |
.derive(hlp.settings() | |
.withRenderNameStyle(RenderNameStyle.LOWER) | |
.withRenderKeywordStyle(RenderKeywordStyle.UPPER) | |
.withRenderFormatted(renderFormatted) | |
) | |
.derive(connectionProvider) | |
.derive(transactionProvider) | |
.derive(executeListenerProvider) | |
.derive(recordMapperProvider) | |
.derive(SQLDialect.ORACLE); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment