SELECT sqlj.set_classpath('postgresforest', 'RePartition:Restore');

CREATE FUNCTION postgresforest.getPartitionNo(bool)
	RETURNS integer
	AS 'org.postgresql.pljava.RePartition.Hash.getPartitionNo(boolean)'
	LANGUAGE java;
CREATE FUNCTION postgresforest.setValue(bool, integer)
	RETURNS bool
	AS 'org.postgresql.pljava.RePartition.Hash.setValue(boolean, java.lang.Integer)'
	LANGUAGE java;
CREATE FUNCTION postgresforest.setValue(bool, text)
	RETURNS bool
	AS 'org.postgresql.pljava.RePartition.Hash.setValue(boolean, java.lang.String)'
	LANGUAGE java;
CREATE FUNCTION postgresforest.setValue(bool, date)
	RETURNS bool
	AS 'org.postgresql.pljava.RePartition.Hash.setValue(boolean, java.sql.Date)'
	LANGUAGE java;
CREATE FUNCTION postgresforest.setValue(bool, time)
	RETURNS bool
	AS 'org.postgresql.pljava.RePartition.Hash.setValue(boolean, java.sql.Time)'
	LANGUAGE java;
CREATE FUNCTION postgresforest.setValue(bool, timestamp)
	RETURNS bool
	AS 'org.postgresql.pljava.RePartition.Hash.setValue(boolean, java.sql.Timestamp)'
	LANGUAGE java;
CREATE FUNCTION postgresforest.getHash(text, bytea, integer)
	RETURNS bool
	AS 'org.postgresql.pljava.RePartition.Hash.getHash(java.lang.String, byte[], java.lang.Integer)'
	LANGUAGE java;

-- FIXME: 'javaU' should work only on pl/java 1.2
CREATE FUNCTION postgresforest.execRestore(text, text, text)
	RETURNS text
	AS 'org.postgresql.pljava.restore.RestoreDB.execRestore(java.lang.String, java.lang.String, java.lang.String)'
	LANGUAGE javaU;

-- FIXME: 'javaU' should work only on pl/java 1.2
CREATE FUNCTION postgresforest.setResoreUser(text, text)
	RETURNS bool
	AS 'org.postgresql.pljava.restore.RestoreDB.setResoreUser(java.lang.String, java.lang.String)'
	LANGUAGE javaU;
