CARVIEW |
Select Language
HTTP/2 301
date: Thu, 31 Jul 2025 09:14:37 GMT
content-type: text/html; charset=utf-8
content-length: 0
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
location: https://github.com/Impetus/kundera/wiki/Embedded-super-columns-in-Cassandra
cache-control: no-cache
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
set-cookie: _gh_sess=lhk2bUJLlqeUAC1tcSZNMRjcTBzfETgwwiB9y7jHk4BBHLwXvYHUgDY6d%2BcBgWXklpMIVvQZbMPCcOIutUP8qVZuTVl59fp55hnDEqGg6fHIo4wsdrWmXL92oZdrNy7kR3V8xGuR6XePPsFJ9KfSLqnNQaeM1k6o%2FXkXOaQLlxBno1fLm5y%2F3NtJjrfYaNfnFMvNognPMg0g3BxlfGaOJo4xOgdMXw9NhpUjjHmhGBjEHztEzWEWYALvAhUUIIuLtNrKnjEyLy0BzWXYOiDYnw%3D%3D--D%2Fet1NRE0qtvyTMa--kxQ5d44ZGIAdnyoDW90rTw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1091814271.1753953277; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 09:14:37 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 09:14:37 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: A64C:373DAE:6BC76D:841E7F:688B33FD
HTTP/2 200
date: Thu, 31 Jul 2025 09:14:38 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"88635b54282ef8c895efcbb66def29f6"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
x-github-request-id: A64C:373DAE:6BC79D:841EC6:688B33FD
Embedded super columns in Cassandra · Impetus/kundera Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 232
Embedded super columns in Cassandra
chhavigangwal edited this page Nov 6, 2013
·
5 revisions
In order to add more dimensions to traditional key value (row -column) model of Cassandra, you can create further sub-columns in a column. This can be done by embedding super columns in Cassandra using thrift.
This can be achieved using Kundera. Following is an example :
@Entity
@Table(name = "USER", schema = "KunderaExamples@twissandraTest")
public class UserCassandra
{
@Id
@Column(name = "USER_ID")
private String userId;
// Embedded object, will persist co-located
@Embedded
private PersonalDetailCassandra personalDetail;
// Embedded object, will persist co-located
@Embedded
private ProfessionalDetailCassandra professionalDetail;
@Embeddable
@IndexCollection(columns = { @Index(name = "professionId"), @Index(name = "departmentName"),
@Index(name = "isExceptional"), @Index(name = "age"), @Index(name = "grade"),
@Index(name = "digitalSignature"), @Index(name = "rating"), @Index(name = "compliance"),
@Index(name = "height"), @Index(name = "enrolmentDate"), @Index(name = "enrolmentTime"),
@Index(name = "joiningDateAndTime"), @Index(name = "yearsSpent"), @Index(name = "uniqueId"),
@Index(name = "monthlySalary"), @Index(name = "birthday"), @Index(name = "birthtime"),
@Index(name = "anniversary"), @Index(name = "jobAttempts"), @Index(name = "accumulatedWealth"),
@Index(name = "graduationDay") })
public class ProfessionalDetailCassandra
{
// Primitive Types
@Column(name = "PROFESSION_ID")
private long professionId;
@Column(name = "DEPARTMENT_NAME")
private String departmentName;
@Column(name = "IS_EXCEPTIONAL")
private boolean isExceptional;
@Column(name = "AGE")
private int age;
@Column(name = "GRADE")
private char grade; // A,B,C,D,E,F for i to vi
@Column(name = "DIGITAL_SIGNATURE")
private byte digitalSignature;
@Column(name = "RATING")
private short rating; // 1-10
@Column(name = "COMPLIANCE")
private float compliance;
@Column(name = "HEIGHT")
private double height;
Cassandra Equivalent :
create column family USER;
Persist an entity using Kundera :
em = emf.createEntityManager();
UserCassandra user1 = new UserCassandra(userId1, "Amresh", "password1", "married");
Calendar cal = Calendar.getInstance();
cal.setTime(new Date(1344079067777l));
user1.setProfessionalDetail(new ProfessionalDetailCassandra(1234567, "Labs", false, 31, 'C', (byte) 8,
(short) 5, (float) 10.0, 163.12, new Date(Long.parseLong("1344079065781")), new Date(Long
.parseLong("1344079067623")), new Date(Long.parseLong("1344079069105")), 2, new Long(
3634521523423L), new Double(0.23452342343), new java.sql.Date(new Date(Long
.parseLong("1344079061111")).getTime()), new java.sql.Time(new Date(Long
.parseLong("1344079062222")).getTime()), new java.sql.Timestamp(new Date(Long
.parseLong("13440790653333")).getTime()), new BigInteger("123456789"),
new BigDecimal(123456789), cal));
em.persist(user1);
Data Stored in cassandra :
RowKey: 0001
=> (super_column=PREFERENCE_ID,
(name=PREFERENCE_ID, value=5031, timestamp=1383739136764))
=> (super_column=professionalDetail,
(name=ACCUMULATED_WEALTH, value=00000000075bcd15, timestamp=1383739136757)
(name=AGE, value=0000001f, timestamp=1383739136757)
(name=ANNIVERSARY, value=00000c396d8d6995, timestamp=1383739136757)
(name=BIRTH_DAY, value=00000138f15ae077, timestamp=1383739136757)
(name=BIRTH_TIME, value=00000138f15ae4ce, timestamp=1383739136757)
(name=COMPLIANCE, value=41200000, timestamp=1383739136757)
(name=DEPARTMENT_NAME, value=4c616273, timestamp=1383739136757)
(name=DIGITAL_SIGNATURE, value=0800000000000000, timestamp=1383739136757)
(name=ENROLMENT_DATE, value=00000138f15af2b5, timestamp=1383739136757)
(name=ENROLMENT_TIME, value=00000138f15af9e7, timestamp=1383739136757)
(name=GRADE, value=0043, timestamp=1383739136757)
(name=GRADUATION_DAY, value=00000138f15afa81, timestamp=1383739136757)
(name=HEIGHT, value=406463d70a3d70a4, timestamp=1383739136757)
(name=IS_EXCEPTIONAL, value=00, timestamp=1383739136757)
(name=JOB_ATTEMPTS, value=075bcd15, timestamp=1383739136757)
(name=JOINING_DATE_TIME, value=00000138f15affb1, timestamp=1383739136757)
(name=MONTHLY_SALARY, value=3fce04dd10e38f48, timestamp=1383739136757)
(name=PROFESSION_ID, value=000000000012d687, timestamp=1383739136757)
(name=RATING, value=0005, timestamp=1383739136757)
(name=UNIQUE_ID, value=0000034e3a5d44df, timestamp=1383739136757)
(name=YEARS_SPENT, value=00000002, timestamp=1383739136757))
-
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
-
Support for Mapped superclass
-
Object to NoSQL Data Mapping
-
Cassandra's User Defined Types and Indexes on Collections
-
Support for aggregation
- Scalar Queries over Cassandra
- Connection pooling using Kundera Cassandra
- Configuration
-
Kundera with Couchdb
-
Kundera with Elasticsearch
-
Kundera with HBase
-
Kundera with Kudu
-
Kundera with RethinkDB
-
Kundera with MongoDB
-
Kundera with OracleNoSQL
-
Kundera with Redis
-
Kundera with Spark
-
Extend Kundera
- Sample Codes and Examples
-
Blogs and Articles
-
Tutorials
* Kundera with Openshift
* Kundera with Play Framework
* Kundera with GWT
* Kundera with JBoss
* Kundera with Spring
-
Performance
-
Troubleshooting
-
FAQ
- Production deployments
- Feedback
Clone this wiki locally
You can’t perform that action at this time.