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

Custom names for foreign collection table #88

Open
fromgate opened this issue Aug 19, 2016 · 0 comments
Open

Custom names for foreign collection table #88

fromgate opened this issue Aug 19, 2016 · 0 comments

Comments

@fromgate
Copy link

Hello!

I have tables with foreign collection table. And all works fine.

But I need to allows users to configure table name (using prefix) and when I tried to create tables using specific configuration (DatabaseTableConfig) I noticed strange behavior:

  1. Base table create fine - table name is correct (defined by DatabaseTableConfig)
    2․ Table with ForeignCollection (specified by @ForeignCollectionField annotation) created with... default name (based on table class name)
  2. Everything still works fine - but foreign collection table has wrong name.
            // This works fine: 
            DatabaseTableConfig<UsersTable> usersTableCfg = new DatabaseTableConfig(UsersTable.class, cfg.tablePrefix + "users", null);
            usersDao = DaoManager.createDao(connection, usersTableCfg);
            TableUtils.createTableIfNotExists(connection, usersTableCfg);

            // This table is created with name "userspermtable":
            DatabaseTableConfig<UsersPermTable> usersPermCfg = new DatabaseTableConfig(UsersPermTable.class, cfg.tablePrefix + "users_perm", null);
            usersPerm = DaoManager.createDao(connection, usersPermCfg);
            TableUtils.createTableIfNotExists(connection, usersPermCfg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant