-
Notifications
You must be signed in to change notification settings - Fork 353
Entity persister
stevenzwu edited this page Jan 3, 2013
·
28 revisions
Astyanax provides entity persister APIs that is similar to Java Persistence API (JPA). Please check out "com.netflix.astyanax.entitystore" package. it replaces the now-deprecated "com.netflix.astyanax.mapping" implementation.
Here is a simple example ` final String id = "foo"; final SampleEntity origEntity = createRandomEntity(id); final EntityManager<SampleEntity, String> entityPersister = new DefaultEntityManager.Builder<SampleEntity, String>() .withEntityType(SampleEntity.class) .withKeyspace(keyspace) .withColumnFamily(CF_SAMPLE_ENTITY) .build();
entityPersister.put(origEntity); SampleEntity getEntity = entityPersister.get(id); entityPersister.delete(id); `
A Netflix Original Production
Tech Blog | Twitter @NetflixOSS | Jobs
- Getting-Started
- Configuration
- Features
- Monitoring
- Thread Safety
- Timeouts
- Recipes
- Examples
- Javadoc
- Utilities
- Cassandra-Compatibility
- FAQ
- End-to-End Examples
- Astyanax Integration with Java Driver