forked from Impetus/kundera
-
Notifications
You must be signed in to change notification settings - Fork 0
Using Compound keys with Kundera
mevivs edited this page Oct 31, 2012
·
12 revisions
Unstructured Data? Scalability is not an issue, use NOSQL! Compound keys is one way to achieve faster search over denormalized data. Kundera(2.2 release on-wards) supports compound key.
You can define compound key with entity definition using @EmbeddedId annotation, like:
@Entity
@Table(name="User", schema="KunderaExamples@mongoTest")
public class PrimeUser
{
@EmbeddedId
private CompoundKey key;
Here key has to be an Embeddable entity:
@Embeddable
public class CompoundKey
{
@Column private String userId;
@Column private int tweetId;
@Column private UUID timeLineId;
Performing any CRUD operation is similar the way, for single primary key.
You can refer here for examples:
**Note:**Current trunk branch supports it for MongoDB and cassandra. Feature will be available with 2.2 release.
-
Datastores Supported
- Releases
-
Architecture
-
Concepts
-
Getting Started in 5 minutes
-
Features
- Object Mapper
- Polyglot Persistence
- Queries Support
- JPQL (JPA Query Language)
- Native Queries
- Batch insert update
- Schema Generation
- Primary Key Auto generation
- Transaction Management
- REST Based Access
- Geospatial Persistence and Queries
- Graph Database Support
-
Composite Keys
-
No hard annotation for schema required
-
Support for Mapped Superclass
- Configuration
- [Kundera with OracleNoSQL] (https://github.com/impetus-opensource/Kundera/wiki/Kundera-OracleNoSQL)
-
Extend Kundera
-
Sample Codes and Examples
- [Blogs and Articles] (https://github.com/impetus-opensource/Kundera/wiki/Blogs--and-Articles)
-
Performance
-
Troubleshooting
-
FAQ
- Feedback