Java 通用存储过程ORMapping的实现 [设想篇]

希望在开发时,写好一个对应的类,设置一些属性就可以直接调用存储
ASon aSon = new ASon();
Object objVal = aSon.execute();
objVal就是存储调用的结果


这样一个对应类,代码可能如下:

@JXDatatSet(SchemaName = " CityCount " ,schemaFlag = SchemaFlag.IsStoredProcedure)
public   class  ASon  extends  A
{
    @JXExectueReturn(PrivateFieldName
="_ReturnValue",JavaSqlTypes="java.sql.Types.INTEGER",Flag = ReturnFlag.IsDouble)
    
public TestSP()throws Exception
    
{}
    
    @JXVar(Name
="parameter1",PrivateFieldName="sIn",JavaTypeName="java.lang.Integer",JavaSqlTypes="java.sql.Types.INTEGER",Flag=VarIOFlag.IsOutput)
    
private Integer sIn;
    
public Integer getParameter1()
    
{
        
return this.sIn;
    }

    
    
public void setParameter1(Integer sIn)
    
{
        
this.sIn = sIn;;
    }

    
    
private Object _ReturnValue;
    
public Object getReturnValue()
    
{
        
return this._ReturnValue;
    }

}

解释:A为基类,其中有如何调用的存储方法:execute()
@JXDatatSet为一个注解,标识存储过程的名称,SchemaFlag为枚举,可以你希望他还有IsTable,IsView这样的数据,用于其它结构的枚举
@JXExectueReturn标识返回值,存储过程可以有多个返回值,比如RETURN前有SELECT语句,会返回结果集,同样RETURN的也会返回,而在ORACLE中会有CURSOR返回结果集
@JXVar是标识存储过程的参数信息
 

如需转载,请表明出处
anthor:[email protected]/[email protected]

你可能感兴趣的:(java,oracle,exception,object,存储,Class)