| java.lang.Object org.geotools.metadata.sql.MetadataSource
MetadataSource | public class MetadataSource (Code) | | A connection to a metadata database. The metadata database can be created
using one of the scripts suggested in GeoAPI, for example
create.sql .
Then, in order to get for example a telephone number, the following code
may be used.
import org.opengis.metadata.citation.
;
...
Connection connection = ...
MetadataSource source = new MetadataSource(connection);
Telephone telephone = (Telephone) source.getEntry(Telephone.class, id);
where
id is the primary key value for the desired record in the
CI_Telephone table.
author: Touraïvane author: Olivier Kartotaroeno author: Martin Desruisseaux since: 2.1 |
Method Summary | |
public synchronized void | close() Close all connections used in this object. | public synchronized Object | getEntry(Class type, String identifier) Returns an implementation of the specified metadata interface filled
with the data referenced by the specified identifier. | final synchronized Object | getValue(Class type, Method method, String identifier) Returns an attribute from a table.
Parameters: type - The interface class. |
metadataPackage | final String metadataPackage(Code) | | The package for metadata interfaces (not the implementation).
|
MetadataSource | public MetadataSource(Connection connection)(Code) | | Creates a new metadata source.
Parameters: connection - The connection to the database. |
close | public synchronized void close() throws SQLException(Code) | | Close all connections used in this object.
|
getEntry | public synchronized Object getEntry(Class type, String identifier) throws SQLException(Code) | | Returns an implementation of the specified metadata interface filled
with the data referenced by the specified identifier. Alternatively,
this method can also returns a
CodeList element.
Parameters: type - The interface to implement (e.g.org.opengis.metadata.citation.Citation), orthe CodeList. Parameters: identifier - The identifier used in order to locate the record forthe metadata entity to be created. This is usually the primary keyof the record to search for. An implementation of the required interface, or the code list element. throws: SQLException - if a SQL query failed. |
getValue | final synchronized Object getValue(Class type, Method method, String identifier) throws SQLException(Code) | | Returns an attribute from a table.
Parameters: type - The interface class. This is mapped to the table name in the database. Parameters: method - The method invoked. This is mapped to the column name in the database. Parameters: identifier - The primary key of the record to search for. The value of the requested attribute. throws: SQLException - if the SQL query failed. |
|
|