Added exportNode() method that takes a DbMapping as second argument.
This commit is contained in:
parent
ff6b590148
commit
adbd17d6aa
1 changed files with 25 additions and 7 deletions
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue