-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routines Don't Respect SchemaMapping #8
Comments
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: 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 |
This is filed as Trac ticket #995 |
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. |
Hmm, yes. The bug is here: 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? |
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! |
This issue is fixed on SVN Trunk, SVN 1.x branch, Github and will be included in the next 2.0.1-SNAPSHOT |
git-svn-id: https://jooq.svn.sourceforge.net/svnroot/jooq/trunk@1622 fe1456f5-c80f-4a60-b34a-41941cf1a92a
Awesome, thank you. |
git-svn-id: https://jooq.svn.sourceforge.net/svnroot/jooq/trunk@1781 fe1456f5-c80f-4a60-b34a-41941cf1a92a
I have a custom function in the database that I incorporate into queries. I use my Routine class to create instances of it as a Field. When I run my queries, however, the routine doesn't respect my schema mapping, and instead always accesses the routine at its codegen-time schema.
The text was updated successfully, but these errors were encountered: