use of org.apache.jena.jdbc.results.metadata.columns.ColumnInfo in project jena by apache.
the class TestCompatibility method test_column_type_detection_integer_03.
/**
* Expect xsd:long to be typed as integers
* @throws SQLException
*/
@Test
public void test_column_type_detection_integer_03() throws SQLException {
ColumnInfo info = testColumnTypeDetection("x", NodeFactory.createLiteral("1234", XSDDatatype.XSDlong), true, Types.BIGINT, Long.class.getCanonicalName());
Assert.assertEquals(0, info.getScale());
Assert.assertTrue(info.isSigned());
}
use of org.apache.jena.jdbc.results.metadata.columns.ColumnInfo in project jena by apache.
the class TestCompatibility method test_column_type_detection_decimal.
/**
* Expect xsd:decimal to be typed as decimal
* @throws SQLException
*/
@Test
public void test_column_type_detection_decimal() throws SQLException {
ColumnInfo info = testColumnTypeDetection("x", NodeFactory.createLiteral("123.4", XSDDatatype.XSDdecimal), true, Types.DECIMAL, BigDecimal.class.getCanonicalName());
Assert.assertEquals(16, info.getScale());
Assert.assertEquals(16, info.getPrecision());
Assert.assertTrue(info.isSigned());
}
use of org.apache.jena.jdbc.results.metadata.columns.ColumnInfo in project jena by apache.
the class TestCompatibility method test_column_type_detection_byte_01.
/**
* Expect xsd:byte to be typed as bytes
* @throws SQLException
*/
@Test
public void test_column_type_detection_byte_01() throws SQLException {
ColumnInfo info = testColumnTypeDetection("x", NodeFactory.createLiteral("123", XSDDatatype.XSDbyte), true, Types.TINYINT, Byte.class.getCanonicalName());
Assert.assertEquals(0, info.getScale());
Assert.assertTrue(info.isSigned());
}
use of org.apache.jena.jdbc.results.metadata.columns.ColumnInfo in project jena by apache.
the class TestCompatibility method test_column_type_detection_integer_02.
/**
* Expect xsd:int to be typed as integers
* @throws SQLException
*/
@Test
public void test_column_type_detection_integer_02() throws SQLException {
ColumnInfo info = testColumnTypeDetection("x", NodeFactory.createLiteral("1234", XSDDatatype.XSDint), true, Types.BIGINT, Long.class.getCanonicalName());
Assert.assertEquals(0, info.getScale());
Assert.assertTrue(info.isSigned());
}
use of org.apache.jena.jdbc.results.metadata.columns.ColumnInfo in project jena by apache.
the class TestCompatibility method test_column_type_detection_byte_02.
/**
* Expect xsd:unsignedByte to be typed as bytes
* @throws SQLException
*/
@Test
public void test_column_type_detection_byte_02() throws SQLException {
ColumnInfo info = testColumnTypeDetection("x", NodeFactory.createLiteral("123", XSDDatatype.XSDunsignedByte), true, Types.TINYINT, Byte.class.getCanonicalName());
Assert.assertEquals(0, info.getScale());
Assert.assertFalse(info.isSigned());
}
Aggregations