public class MetadataSource extends Object
create.sql
. Then, in order to get for example a telephone number, the following code may be used.
whereimport org.opengis.metadata.citation.Telephone; ... Connection connection = ... MetadataSource source = new MetadataSource(connection); Telephone telephone = (Telephone) source.getEntry(Telephone.class, id);
id is the primary key value for the desired record in the CI_Telephone
table.| Constructor and Description |
|---|
MetadataSource(Connection connection)
Creates a new metadata source.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close all connections used in this object.
|
Object |
getEntry(Class type,
String identifier)
Returns an implementation of the specified metadata interface filled with the data referenced
by the specified identifier.
|
public MetadataSource(Connection connection)
connection - The connection to the database.public Object getEntry(Class type, String identifier) throws SQLException
CodeList
element.type - The interface to implement (e.g. Citation),
or the CodeList.identifier - The identifier used in order to locate the record for the metadata entity
to be created. This is usually the primary key of the record to search for.SQLException - if a SQL query failed.public void close()
throws SQLException
SQLExceptionCopyright © 1996–2019 Geotools. All rights reserved.