-
Notifications
You must be signed in to change notification settings - Fork 233
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
hard-annotation for schema #315
Comments
Currently it is not possible. We will see, if can provide any alternative for this. However schema definition is by default imposed by JPA itself. Ideally it should have been present. Tools like Hibernate have deal with Traditional RDBMSs only. Which more or less offer symmetric symantec. But it certainly differs with various no sql databases. Will post an update on this, Later. -Vivek |
Since the schema annotation for kundera is defined as "key space"@"pu name", while in the persistence.xml, we already configured both. so, information is enough there, and also by removing that out of the java code, we can change the db without changing the code and recompile. |
Consider a scenario, say there is an entity Person without schema definition:
Now if persistence.xml contains two persistence units(Cassandra and MongoDB each) as:
Question is, How do we resolve whether Person entity belongs to mongo or Cassandra persistence unit? -Vivek |
the entity can belong to both persistence unit. |
True, in case of single persistence unit. But it will not work in case of polyglot persistence scenarios. Where you create an entitmanagerfactory as: Persistence.createEntityManagerFactory("cass_pu","mongoTest"); -Vivek |
currently by hard coded schema in the java entity, then single entity can't be persistent into different datastore. (so can not support polyglot). |
True, we did thought about it. But -Vivek |
but schema value within @table is also optional, no? |
Yes. So out of these two we have implemented using @table annotation. Will discuss within team, if alternative approach by using -Vivek |
+1 it would be very useful, we had the same situation with 2 PUs and shared entities two month ago and it was very painful to copy-paste same entity classes for different PUs. |
+1 I also like making the schema @table annotation optional when
|
I see a point here. Looks like, we need to discuss and find a way for this, will plan a discussion and post an update on this. -Vivek |
Work in progress on this. Suggested changes:
For Single persistence unit:
Polyglot persistence:
Planned for 2.8 release. -Vivek |
Glad to hear it! Any estimates? |
2.8 release. Will post an update as soon as i commit this in latest trunk -Vivek |
Releasing with 2.8 |
now, it seems in each @entity, we must have the "schema" hard annotated.
by doing this, preventing this entity to be reused by other tools, like hibernate.
i would like to know whether it is possible to have this configured in some kundera or cassandra specific configuration instead in the javax.persistence entity code.
The text was updated successfully, but these errors were encountered: