0

does anyone know of a DataStax API to get what Cassandra native type will be used for a non-annotated field in an @Table pojo? E.g.

private byte age; //maps to tinyint

2 Answers 2

0

The CQL data type to Java type can be found here. I don't think there is an actual API that will return these values.

0

I ended up using the CodecRegistry with a combination of reflective code to get all the available codecs to build a map of Java types to CqlTypes.

edit

Obtaining a bean reference to CassandraMappingContext is even easier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.