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

make tenantId an object type for more flexibility #23

Open
basejump opened this issue Jun 7, 2012 · 3 comments
Open

make tenantId an object type for more flexibility #23

basejump opened this issue Jun 7, 2012 · 3 comments

Comments

@basejump
Copy link
Contributor

basejump commented Jun 7, 2012

currently we are locked into integer.
a. grails uses long as default for id's
b. we are also looking at using a UUID as an option right now too.

Does anyone foresee an issue with this?
CurrentTenant.get would return and object now instead.

@lucastex
Copy link
Member

lucastex commented Jun 7, 2012

Since the plugin uses the current tenant in all queries, the tenant value must have a "plain" way to save it in one database field. So, if we want to use an object as tenant representation, we should have a simple way to 'serialize' it and bring it back. Probably the tenant object should implement an interface with kind of marshal() and unmarshal() methods, or kind of that. Right? Then, when modifying the query in the database, the plugin would add the 'serialized tenant way'.

Don't know if I made myself clear :)

@basejump
Copy link
Contributor Author

basejump commented Jun 7, 2012

when you say tenant object , what do you mean?
also for the filter its setup as follows
multiTenantHibernateFilter(FilterDefinitionFactoryBean) {
defaultFilterCondition = ":tenantId = $tenantColumnName"
parameterTypes = [ tenantId: "java.lang.Integer" ]
}
we can make the type config come from the config.

@lucastex
Copy link
Member

lucastex commented Jun 7, 2012

externalizing this config, to come from the config would be fine.
we could use strings or other field types with no problems.

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

No branches or pull requests

3 participants