I have a big problem using datastax java-driver-mapping within karaf 4.1.0-SNAPSHOT, I need to get the annotation @Table from cassandra entity in this case:
@Table(name = "clients")
public class Client implements Serializable {
@PartitionKey
@Column(name = "client_id")
private String clientId;
@Column(name = "client_secret")
private String clientSecret;
//getters and setters ...
}
This entity is in a models bundle, I have a bundle for services and one to persistence, when I try to do this in my persistence bundle:
@Override
public void save(Serializable obj, Class clazz) {
System.out.println(((Table)clazz.getAnnotations()[0]).name());
}
I get this error in the line of System.out.println:
java.lang.ClassCastException: com.sun.proxy.$Proxy110 cannot be cast to com.datastax.driver.mapping.annotations.Table
at io.twim.cassandra.TwimCassandraImpl.save(TwimCassandraImpl.java:159) [216:twim-cassandra:1.0.0.SNAPSHOT]
at Proxyc0a03eb5_6454_4ea2_a12f_daddf586d502.save(Unknown Source) [?:?]
at io.twim.core.users.TwimServiceUserImpl.saveApplicationClient(TwimServiceUserImpl.java:50) [218:twim-core:1.0.0.SNAPSHOT]
at Proxy60a7b95f_6d2d_4487_bd18_dfd7c359a958.saveApplicationClient(Unknown Source) [?:?]
at io.twim.rest.register.ClientRegistrationImpl.init(ClientRegistrationImpl.java:69) [223:twim-rest:1.0.0.SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:?]
at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:299) [12:org.apache.aries.blueprint.core:1.7.0]
What should I do to fix this problem? Anyone have any idea?
EDITED