提交 538195c4 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 9838c2c2
...@@ -45,6 +45,16 @@ public class FunctionAlias extends DbObjectBase { ...@@ -45,6 +45,16 @@ public class FunctionAlias extends DbObjectBase {
initDbObjectBase(db, id, name, Trace.FUNCTION); initDbObjectBase(db, id, name, Trace.FUNCTION);
} }
/**
* Create a new alias based on a method name.
*
* @param db the database
* @param id the id
* @param name the name
* @param javaClassMethod the class and method name
* @param force create the object even if the class or method does not exist
* @return the database object
*/
public static FunctionAlias newInstance(Database db, int id, String name, String javaClassMethod, boolean force) throws SQLException { public static FunctionAlias newInstance(Database db, int id, String name, String javaClassMethod, boolean force) throws SQLException {
FunctionAlias alias = new FunctionAlias(db, id, name); FunctionAlias alias = new FunctionAlias(db, id, name);
int paren = javaClassMethod.indexOf('('); int paren = javaClassMethod.indexOf('(');
...@@ -58,6 +68,16 @@ public class FunctionAlias extends DbObjectBase { ...@@ -58,6 +68,16 @@ public class FunctionAlias extends DbObjectBase {
return alias; return alias;
} }
/**
* Create a new alias based on source code.
*
* @param db the database
* @param id the id
* @param name the name
* @param source the source code
* @param force create the object even if the class or method does not exist
* @return the database object
*/
public static FunctionAlias newInstanceFromSource(Database db, int id, String name, String source, boolean force) throws SQLException { public static FunctionAlias newInstanceFromSource(Database db, int id, String name, String source, boolean force) throws SQLException {
FunctionAlias alias = new FunctionAlias(db, id, name); FunctionAlias alias = new FunctionAlias(db, id, name);
alias.source = source; alias.source = source;
......
...@@ -24,7 +24,7 @@ CREATE OR REPLACE FUNCTION increment(i integer) RETURNS integer AS $$ ...@@ -24,7 +24,7 @@ CREATE OR REPLACE FUNCTION increment(i integer) RETURNS integer AS $$
BEGIN BEGIN
RETURN i + 1; RETURN i + 1;
END; END;
$$ LANGUAGE plpgsql; $$ LANGUAGE ...;
create alias newFunctionAliasName [ DETERMINISTIC ] create alias newFunctionAliasName [ DETERMINISTIC ]
as as
......
...@@ -619,4 +619,4 @@ deactivation concatenating reproducing black railroads railroad radius moz ...@@ -619,4 +619,4 @@ deactivation concatenating reproducing black railroads railroad radius moz
imageio argb bilinear rendering stroke interpolation flip diagrams draw imageio argb bilinear rendering stroke interpolation flip diagrams draw
delim overlap subselect bitwise dclassifier dgenerate compacts chartrand phane delim overlap subselect bitwise dclassifier dgenerate compacts chartrand phane
sval cement slave ulimit eclipselink glenn kidd rapidshare score relevance sval cement slave ulimit eclipselink glenn kidd rapidshare score relevance
autovacuum vacuuming autovacuum vacuuming endlessly talking
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论