10
I have the following dominance of the type polygon
in the database:
CREATE DOMAIN "global".polygon AS pg_catalog.polygon;
The following table using this domain:
CREATE TABLE user.area_geom
(
id_area_geom serial NOT NULL,
polygon global.polygon
);
And the following class extending DBTestCase
setting up the dataset before the tests are run:
public abstract class MyDBTestCase extends DBTestCase {
public MyDBTestCase () {
// Configura url, user, password e driver do banco de dados.
}
@Override
protected IDataSet getDataSet() throws Exception {
// Meu arquivo .xml com os dados de teste.
return new FlatXmlDataSetBuilder()
.build(new FileInputStream(MyTestDB.FLAT_XML_DATASET));
}
@Override
protected void setUpDatabaseConfig(DatabaseConfig config) {
/* Habilita case sensitive para os nomes de tabelas do banco */
config.setProperty(DatabaseConfig.FEATURE_CASE_SENSITIVE_TABLE_NAMES,
true);
/* Habilita a utilização de fully qualified names para tabelas */
config.setProperty(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, true);
/* Configura o tipo de dado para o PostgreSQL */
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY,
new PostgresqlDataTypeFactory());
}
}
This setup works perfectly for all commonly used data types, but when I checked the table area_geom
containing a domain of the type polygon
, the console started generating the following output:
9081 [main] WARN org.dbunit.util.SQLHelper - area_geom.polygon data type (1111, 'polygon') not recognized and will be ignored. See FAQ for more information.
In the FAQ proposed by the error message, there is nothing that indicates me how to implement a "custom" data type on top of an existing data type, nor do Dbunit recognize my polygon
, I’ve already spent a few hours of Google and found nothing.
Someone has some light for this problem?
Have you tried using the Postgis?
– Peter Krauss
Peter, I already use Postgis at the database level, but no jar on my project. The implementation for the recognition of Postgis data types can also be done according to the Aelia response.
– Bruno Gasparotto