GithubHelp home page GithubHelp logo

Routines Don't Respect SchemaMapping about jooq HOT 7 CLOSED

jooq avatar jooq commented on June 11, 2024
Routines Don't Respect SchemaMapping

from jooq.

Comments (7)

lukaseder avatar lukaseder commented on June 11, 2024

Hmm, the integration tests don't explicitly cover routines. This worked before, but there's probably a regression that has been introduced with version 1.6.8:
https://sourceforge.net/apps/trac/jooq/ticket/852

Can you provide me with an example of how you're using routines with schema mappings? Are you calling them as standalone routines or embedded in SQL?

Cheers
Lukas

from jooq.

lukaseder avatar lukaseder commented on June 11, 2024

This is filed as Trac ticket #995
https://sourceforge.net/apps/trac/jooq/ticket/995

from jooq.

dacc avatar dacc commented on June 11, 2024

We're calling them embedded in SQL by composing them in as Field, in this case. I traced into the Routine class and couldn't see anywhere to supply a Configuration, except in the usage where it actually calls the function in the DB and returns a value.

from jooq.

lukaseder avatar lukaseder commented on June 11, 2024

Hmm, yes. The bug is here:
https://github.com/lukaseder/jOOQ/blob/ee409d83fbdbd0401f37926967b027937167134e/jOOQ/src/main/java/org/jooq/impl/AbstractRoutine.java#L540

The schema name is hard-wired in the routine's Field representation at SQL build time, not at SQL render time. Unfortunately, at SQL build time, the SchemaMapping is not available.

A workaround that might work for you before I fix this, is to replace the call to getQualifiedName() by getName() and omit the schema?

Are you using jOOQ 2.0 or 1.x?

from jooq.

dacc avatar dacc commented on June 11, 2024

We're using jOOQ 2.0.0-SNAPSHOT.

We have a work-around right now, which is simply to create a database with only the function in it so that jOOQ finds it where expected.

Thanks!

from jooq.

lukaseder avatar lukaseder commented on June 11, 2024

This issue is fixed on SVN Trunk, SVN 1.x branch, Github and will be included in the next 2.0.1-SNAPSHOT

from jooq.

dacc avatar dacc commented on June 11, 2024

Awesome, thank you.

from jooq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.