Hello there,
In the process of majorly refactoring a JIRA add-on, I am trying to figure out a way to use a certain table prefix for certain tables, and another one for others... I've found some references to (activeobject's) TableNameConverter around, which seems to be the way to implement just that, but I'm struggling to find any info about how to actually inject my own TableNameConverter implementation inside the ActiveObjects/EntityManager object. I am currently using a standard AO config. Do any of you know how to configure that (via atlassian-plugin.xml?, spring.xml?) or know another way of controlling the generated database table names prefixes?
Marc
Why don't you just use the @Table annotation to specify the table for each of your entities?
Unfortunately, the Table annotation just allows you to control the last part of the generated table names, e.g. ITEM in AO_A1B2C3_ITEM. The part I would like to get a hook on is the generated prefix ("A1B2C3" in the example). I know there's a namespace attribute that let you use something else than the plugin's key that is used to generate this, but unfortunately in my case I have entities coming from two different add-ons, thus having different prefixes. Basically, what I would like would be to be able to set a namespace per entity, rather than for all entities at once.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What I'm doing is to split an add-on into two. The problem is that I have many entities that end up in an activeobjects config with a different namespace, thus creating a whole new set of tables. Since I have many users already using my add-on, I don't want them to lose their data. The only workaround I can think of right now is to use a massive, error-prone database upgrade task to move data to another set of tables. So if I had a way to simply tell activeobjects to use the old prefix for the entities I moved, then no migration would be required and it would simplify things dramatically...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not believe there is supported way to inject your own TableNameConverter. Is it "must" to do? Maybe you can find other way around like adding suffixes to your entities.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.