Added exportNode() method that takes a DbMapping as second argument.

This commit is contained in:
hns 2004-05-05 14:31:17 +00:00
parent ff6b590148
commit adbd17d6aa

View file

@ -474,12 +474,30 @@ public final class NodeManager {
if (dbs == null) {
throw new IllegalArgumentException("DbSource can't be null in exportNode");
} else if ((dbm == null) || !dbm.isRelational()) {
throw new SQLException("Can't export into non-relational database");
throw new IllegalArgumentException("Can't export into non-relational database");
} else {
insertRelationalNode(node, dbm, dbs.getConnection());
}
}
/**
* Insert a node into a different (relational) database than its default one.
*/
public void exportNode(Node node, DbMapping dbm)
throws IOException, SQLException, ClassNotFoundException {
if (node == null) {
throw new IllegalArgumentException("Node can't be null in exportNode");
}
if (dbm == null) {
throw new IllegalArgumentException("DbMapping can't be null in exportNode");
} else if ((dbm == null) || !dbm.isRelational()) {
throw new IllegalArgumentException("Can't export into non-relational database");
} else {
insertRelationalNode(node, dbm, dbm.getConnection());
}
}
/**
* Insert a node into a relational database.
*/