Skip to content
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

Schema and table name customization #420

Closed
ilx opened this issue May 17, 2013 · 5 comments
Closed

Schema and table name customization #420

ilx opened this issue May 17, 2013 · 5 comments
Milestone

Comments

@ilx
Copy link

@ilx ilx commented May 17, 2013

Please support following scenario:

  • user defines tables that start with prefix T_ in SCHEMA_A
  • user defines public synonyms for tables from SCHEMA_A in SCHEMA_B, and removes prefix T_ in the process

Now, user can create metadata from T_* tables in schema SCHEMA_A, but in runtime user has to use synonyms from SCHEMA_B.

There are two solutions:

  • allow generator to rename schema and tables in generated code
  • support schema and table name customization in the runtime
@timowest
Copy link
Member

@timowest timowest commented May 19, 2013

The runtime option is more flexible, so I will start sketching it.

Maybe configuration options in the Configuration class could work.

@timowest
Copy link
Member

@timowest timowest commented May 20, 2013

Overrides can now be registered via the Configuration class

    Configuration configuration = new Configuration(new H2Templates());
    configuration.registerSchemaOverride("public", "pub");
    configuration.registerTableOverride("employee", "emp");
    configuration.registerTableOverride("public", "employee", "employees");

    assertEquals("pub", configuration.getSchema("public"));
    assertEquals("emp", configuration.getTable("", "employee"));
    assertEquals("employees", configuration.getTable("public", "employee"));
@ilx
Copy link
Author

@ilx ilx commented May 22, 2013

Cool, thanks!
When can we expect it in the snapshots?

@timowest
Copy link
Member

@timowest timowest commented May 22, 2013

It's now available in the 3.1.2.BUILD-SNAPSHOT

@timowest
Copy link
Member

@timowest timowest commented May 27, 2013

Released in 3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants