File tree Expand file tree Collapse file tree
main/java/com/datastax/driver/mapping
test/java/com/datastax/driver/mapping Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ public class Mapper<T> {
7575 this .mapper = mapper ;
7676
7777 KeyspaceMetadata keyspace = session ().getCluster ().getMetadata ().getKeyspace (mapper .getKeyspace ());
78- this .tableMetadata = keyspace == null ? null : keyspace .getTable (Metadata . quote ( mapper .getTable () ));
78+ this .tableMetadata = keyspace == null ? null : keyspace .getTable (mapper .getTable ());
7979
8080 this .protocolVersion = manager .getSession ().getCluster ().getConfiguration ().getProtocolOptions ().getProtocolVersionEnum ();
8181 this .mapOneFunction = new Function <ResultSet , T >() {
Original file line number Diff line number Diff line change @@ -419,6 +419,18 @@ public void should_map_objects_from_partial_queries() throws Exception {
419419 session .execute ("delete from posts where user_id = " + u1 .getUserId ());
420420 }
421421
422+
423+ @ Test (groups ="short" )
424+ public void should_return_table_metadata () throws Exception {
425+ MappingManager manager = new MappingManager (session );
426+
427+ Mapper <Post > m = manager .mapper (Post .class );
428+
429+ assertThat (m .getTableMetadata ()).isNotNull ();
430+ assertThat (m .getTableMetadata ().getName ()).isEqualTo ("posts" );
431+ assertThat (m .getTableMetadata ().getPartitionKey ()).hasSize (1 );
432+ }
433+
422434 @ Test (groups ="short" )
423435 public void should_not_initialize_session_when_protocol_version_provided () {
424436 Session newSession = cluster .newSession ();
You can’t perform that action at this time.
0 commit comments