^1640696310010
@
sname
CassandraDataObject
slabel
CassandraDataObject
sdescriptors
xworker.lang.MetaDescriptor3
sextends
xworker.dataObject.DataObject
smany
true
seditCols
2
sinitialization
false
smodifier
public
sinheritDescription
false
sicon
icons/database_table.png
Sdescription
#$@text#$@
<p>数据库数据对象，映射数据库中的表。</p>

<p><strong>DDL</strong></p>

<p>&nbsp;&nbsp;&nbsp; 现在通过Hibernate执行 DDL，在属性中可以看到相关字段，其中自动增长的标识字段使用generate=native，oralce会创建一个名为hibernate_sequence的序列，其他请参看hibenrate。</p>
#$@text#$@
snotXmlAttribute
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
  @/@actions
  sname
  actions
  slabel
  actions
  sdescriptors
  xworker.lang.MetaDescriptor3/@actions
  sid
  actions
    @/@actions/@create
    sname
    doCreate
    slabel
    doCreate
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.dataObject.db.DbDataObject
    smethodName
    create
    sdisableGlobalContext
    false
    sattributeTemplate
    false
    sinterpretationType
    Action
    svarScope
    Global
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@JavaAction
    sth_createIndex
    false
    sid
    create
      @/@actions/@create/@contexts
      sname
      contexts
      slabel
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sid
      contexts
        @/@actions/@create/@contexts/@dataSource
        sname
        dataSource
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        self.dataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
        sid
        dataSource
    @/@actions/@update
    sname
    doUpdate
    slabel
    doUpdate
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.dataObject.db.DbDataObject
    smethodName
    update
    sdisableGlobalContext
    false
    sattributeTemplate
    false
    sinterpretationType
    Action
    svarScope
    Global
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@JavaAction
    sth_createIndex
    false
    sid
    update
      @/@actions/@update/@contexts
      sname
      contexts
      slabel
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sid
      contexts
        @/@actions/@update/@contexts/@dataSource
        sname
        dataSource
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        self.dataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
        sid
        dataSource
    @/@actions/@updateBatch
    sname
    updateBatch
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.dataObject.db.DbDataObject
    smethodName
    updateBatch
    sdisableGlobalContext
    false
    sdescription
    <p>批量更新，根据查询条件查找并更新符合条件的记录。</p>
    sdescriptors
    xworker.lang.actions.Actions/@JavaAction
    sth_createIndex
    false
    sid
    updateBatch
      @/@actions/@updateBatch/@contexts
      sname
      contexts
      slabel
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sid
      contexts
        @/@actions/@updateBatch/@contexts/@dataSource
        sname
        dataSource
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        self.dataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
        sid
        dataSource
      @/@actions/@updateBatch/@ins
      sisValidate
      false
      sname
      ins
      slabel
      ins
      sdescriptors
      xworker.lang.actions.Inout/@ins
      sid
      ins
        @/@actions/@updateBatch/@ins/@theData
        sname
        theData
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescription
        <p>数据对象。</p>
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        theData
        @/@actions/@updateBatch/@ins/@conditionData
        sname
        conditionData
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescription
        <p>查询条件数据。</p>
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sth_createIndex
        false
        sid
        conditionData
        @/@actions/@updateBatch/@ins/@conditionConfig
        sname
        conditionConfig
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sth_createIndex
        false
        sid
        conditionConfig
    @/@actions/@delete
    sname
    doDelete
    slabel
    doDelete
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.dataObject.db.DbDataObject
    smethodName
    delete
    sdisableGlobalContext
    false
    sattributeTemplate
    false
    sinterpretationType
    Action
    svarScope
    Global
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@JavaAction
    sth_createIndex
    false
    sid
    delete
      @/@actions/@delete/@contexts
      sname
      contexts
      slabel
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sid
      contexts
        @/@actions/@delete/@contexts/@dataSource
        sname
        dataSource
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        self.dataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
        sid
        dataSource
    @/@actions/@deleteBatch
    sname
    deleteBatch
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.dataObject.db.DbDataObject
    smethodName
    deleteBatch
    sdisableGlobalContext
    false
    sdescription
    <p>批量删除，根据查询条件查找并删除符合条件的记录。</p>
    sdescriptors
    xworker.lang.actions.Actions/@JavaAction
    sth_createIndex
    false
    sid
    deleteBatch
      @/@actions/@deleteBatch/@contexts
      sname
      contexts
      slabel
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sid
      contexts
        @/@actions/@deleteBatch/@contexts/@dataSource
        sname
        dataSource
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        self.dataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
        sid
        dataSource
      @/@actions/@deleteBatch/@ins
      sisValidate
      false
      sname
      ins
      slabel
      ins
      sdescriptors
      xworker.lang.actions.Inout/@ins
      sid
      ins
        @/@actions/@deleteBatch/@ins/@theData
        sname
        theData
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescription
        <p>数据对象。</p>
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        theData
        @/@actions/@deleteBatch/@ins/@conditionData
        sname
        conditionData
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescription
        <p>查询条件数据。</p>
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sth_createIndex
        false
        sid
        conditionData
        @/@actions/@deleteBatch/@ins/@conditionConfig
        sname
        conditionConfig
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sth_createIndex
        false
        sid
        conditionConfig
    @/@actions/@load
    sname
    doLoad
    slabel
    doLoad
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import xworker.dataObject.DataObject;
import xworker.dataObject.DataObjectList;
import xworker.dataObject.utils.DbUtil;

def keyDatas = theData.getKeyAndDatas();
if(keyDatas == null || keyDatas.length == 0){
    log.warn("no keys data cannot load, dataObjectPath=" + theData.getMetadata().getDescriptor().metadata.path);
    throw new Exception("No keys, data cannot load");
}

//生成insert sql语句
def rattributes = theData.getMetadata().getAttributes();
def attributes = [];
for(int i=0; i<rattributes.size(); i++){
    if(!rattributes[i].getBoolean("dataField")){
        continue;
    }
    
    attributes.add(rattributes[i]);
}

def sql = "select ";
for(int i=0; i<attributes.size(); i++){
    if(!attributes[i].getBoolean("dataField")){
        continue;
    }
    def fieldSql = attributes[i].sql;
    if(fieldSql != null && fieldSql != ""){
        sql = sql + fieldSql;
    }else{
        sql = sql + attributes[i].fieldName;
    }
    if(i < attributes.size() - 1){
        sql = sql + ",";
    }
}
def tableName = self.tableName;
if(self.querySql != null && self.querySql != ""){
    tableName = self.querySql;
}
sql = sql + " from " + tableName + " where ";
for(int i=0; i<keyDatas.length; i++){
    sql = sql + keyDatas[i][0].get("fieldName") + "=?";
    if(i < keyDatas.length -1){
        sql = sql + " and ";
    }
}
if(self.getBoolean("showSql")){
    log.info(sql);
}

//设置参数值
def pst = null;
def rs = null;
try{
    pst = con.prepareStatement(sql);
    def index = 1;
    for(int i=0; i<keyDatas.length; i++){
        //log.info(keyDatas[i][0].get("name") + "=" + keyDatas[i][1]);
        DbUtil.setParameterValue(pst, index + i, keyDatas[i][0].get("type"), keyDatas[i][1]);
    }
    
    //执行sql
    rs = pst.executeQuery();
    if(rs.next()){
        //构造对象
        theData.setInited(false);
        
        //设置属性值
        for(int i=0; i<attributes.size(); i++){
            theData.put(attributes[i].get("name"), DbUtil.getValue(rs, attributes[i]));
        }
        
        theData.setInited(true);   
        return theData;    
    }else{
        return null;
    }
}finally{
    if(rs != null){
        rs.close();
    }
    if(pst != null){
        pst.close();
    }
}
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    load
      @/@actions/@load/@contexts
      sname
      contexts
      slabel
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sid
      contexts
        @/@actions/@load/@contexts/@dataSource
        sname
        dataSource
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        self.dataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
        sid
        dataSource
    @/@actions/@query
    sname
    doQuery
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.dataObject.db.DbDataObject
    smethodName
    query
    sdisableGlobalContext
    false
    sattributeTemplate
    false
    sinterpretationType
    Action
    svarScope
    Global
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@JavaAction
    sth_createIndex
    false
    sid
    query
      @/@actions/@query/@contexts
      sname
      contexts
      slabel
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sid
      contexts
        @/@actions/@query/@contexts/@dataSource
        sname
        dataSource
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        self.dataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
        sid
        dataSource
      @/@actions/@query/@ins
      sisValidate
      false
      sname
      ins
      slabel
      ins
      sdescriptors
      xworker.lang.actions.Inout/@ins
      sid
      ins
        @/@actions/@query/@ins/@datas
        sname
        conditionData
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescription
        <p>查询参数</p>
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        datas
        @/@actions/@query/@ins/@condition
        sname
        condition
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescription
        <p>查询条件定义</p>
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        condition
    @/@actions/@generateId
    sname
    generateSeqId
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
def seqName = self.sequenceName;
if(seqName == null || seqName ==""){
    if(self.idGenerateType == "native"){
        //native是通过hibernate生成的
        seqName = "HIBERNATE_SEQUENCE";
    }
}
if(seqName == null || seqName ==""){
    throw new Exception("SequenceName is null");
}

int dotIndex = seqName.indexOf(".");
if(dotIndex != -1){
	//使用从表中读取Seq的方法
	String tableName = seqName.substring(0, dotIndex);
	String sName = seqName.substring(dotIndex + 1, seqName.length());
	
	def rs = null;
	def ps = null;
	try{
		ps = con.prepareStatement("select seq from " + tableName + " where name = ? for update");
		ps.setString(1, sName);
		rs = ps.executeQuery();
		if(rs.next()){
			int seq = rs.getInt("seq");
			
			rs.close();
			ps.close();
			
			ps = con.prepareStatement("update " + tableName + " set seq = seq +1 where name=?");
			ps.setString(1, sName);
			ps.execute();
			
			return seq +1;
		}else{
			rs.close();
			ps.close();
			
			ps = con.prepareStatement("insert into " + tableName + "(name, seq) values(?, 1)");
			ps.setString(1, sName);
			ps.execute();
			return 1;
		}
	}finally{
	    if(rs != null){
	        rs.close();
	    }
	    if(ps != null){
	        ps.close();
	    }
	}
}else{
    def driverName = con.getMetaData().getDriverName();
    if(driverName != null && driverName.indexOf("Oracle") != -1){
        //oracle数据库
        def sql = "select " + seqName + ".nextval as nextID from dual";
        def pst = con.prepareStatement(sql);
        def rs = null;
        try{
            rs = pst.executeQuery();
            if(rs.next()){
                return rs.getInt("nextID");
            }else{
                throw new Exception("cannot get seq from " + self.sequenceName);
            }
        }finally{
             if(rs != null){
                 rs.close();
             }
             if(pst != null){
                 pst.close();
             }
        }
    }else{
        log.warn("database driver " + driverName + " not supported sequence");
        //throw new Exception("database driver " + driverName + " not supported sequence");
    }
}
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    generateId
      @/@actions/@generateId/@contexts
      sname
      contexts
      slabel
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sid
      contexts
        @/@actions/@generateId/@contexts/@dataSource
        sname
        dataSource
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        self.dataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
        sid
        dataSource
    @/@actions/@generateNativeId
    sname
    generateNativeId
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
String driverName = con.getMetaData().getDriverName();
if(driverName != null && driverName.indexOf("Oracle") != -1){
	return self.doAction("generateSeqId", actionContext);     
}else{
    return null;
}
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    generateNativeId
    @/@actions/@getCreateTableSql
    sname
    getCreateTableSql
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
def sqlType = "oracle";
def tableName = self.tableName;
//数据库字段
def sql = "create table " + tableName;
for(attr in self.getChilds("attribute")){
    if(attr.getBoolean("dataField")){
        def columnName = attr.fieldName;
        def columnType = "";
        def type = attr.type;
        if(type == null || type == ""){
            type = "string";
        }
        def length = attr.length;
        def precision = attr.precision;
        def primaryKey = attr.key;
        switch(type){
            case "string":
                columnType = "
            case "byte":
            case "short":
            case "int":
            case "long":
            case "float":
            case "double":
            case "boolean":
            case "date":
            case "datetime":
            case "time":
            case "byte[]":
            case "stream":            
        }
        if(primaryKey == ""){
        }
    }
}
#$@text#$@
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    getCreateTableSql
    @/@actions/@getDropTableSql
    sname
    getDropTableSql
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    getDropTableSql
    @/@actions/@getOracleSqlType
    sname
    getOracleSqlType
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
def type = attribute.type;
if(type == null || type == ""){
    type = "string";
}
def length = attr.length;
def precision = attr.precision;
def primaryKey = attr.key;
#$@text#$@
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    getOracleSqlType
      @/@actions/@getOracleSqlType/@ins
      sisValidate
      false
      sname
      ins
      slabel
      ins
      sdescriptors
      xworker.lang.actions.Inout/@ins
      sid
      ins
        @/@actions/@getOracleSqlType/@ins/@type
        sname
        type
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        type
        @/@actions/@getOracleSqlType/@ins/@length
        sname
        length
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        length
        @/@actions/@getOracleSqlType/@ins/@precision
        sname
        precision
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        precision
        @/@actions/@getOracleSqlType/@ins/@primaryKey
        sname
        primaryKey
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        primaryKey
    @/@actions/@getDerbySqlType
    sname
    getDerbySqlType
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
switch(type){
    case "string":
        return "varchar(" + length + ")";
    case "byte":
    case "short":
    case "int":
    case "long":
    case "float":
    case "double":
    case "boolean":
    case "date":
    case "datetime":
    case "time":
    case "byte[]":
    case "stream":    
}
#$@text#$@
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    getDerbySqlType
      @/@actions/@getDerbySqlType/@ins
      sisValidate
      false
      sname
      ins
      slabel
      ins
      sdescriptors
      xworker.lang.actions.Inout/@ins
      sid
      ins
        @/@actions/@getDerbySqlType/@ins/@type
        sname
        type
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        type
        @/@actions/@getDerbySqlType/@ins/@length
        sname
        length
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        length
        @/@actions/@getDerbySqlType/@ins/@precision
        sname
        precision
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        precision
        @/@actions/@getDerbySqlType/@ins/@primaryKey
        sname
        primaryKey
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        primaryKey
    @/@actions/@queryOracle
    sname
    queryOraclePage
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import xworker.dataObject.DataObject;
import xworker.dataObject.DataObjectList;
import xworker.dataObject.utils.DbUtil;

def pst = null;
def rs = null;
try{
    //查询总数
    def countSql = "select count(*) from (" + sql + ") ";
    pst = con.prepareStatement(countSql);
    
    //设置查询参数
    self.doAction("setStatementParams", actionContext, ["cds":cds, "pst":pst, "attributes":attributes, "index":1]);
    rs = pst.executeQuery();
    rs.next();
    pageInfo.totalCount = rs.getInt(1);
    rs.close();
    pst.close();
    
    //分页查询
    sql = "select * from (select t.*, rownum rowno from (" + sql + ") t ) where rowno between ? and ?";
    if(self.getBoolean("showSql")){
        log.info(sql);
    }
    pst = con.prepareStatement(sql);
    self.doAction("setStatementParams", actionContext, ["cds":cds, "pst":pst, "attributes":attributes, "index":1]);
    if(pageInfo != null && pageInfo.limit != 0){
        def index = cds.size() + 1;
        def start = pageInfo.start + 1;
        pst.setInt(index, start);
        pst.setInt(index + 1, start + pageInfo.limit - 1);
    }
    
    //执行sql
    rs = pst.executeQuery();
    def ds =[];
    attributes = self.get("attribute@"); //取查询数据对象实际的列
    while(rs.next()){
        //构造对象
        def data = new DataObject(self);
        data.setInited(false);
        
        //设置属性值
        for(int i=0; i<attributes.size(); i++){
            if(!attributes[i].getBoolean("dataField")){
                continue;
            }
            
            try{
                data.put(attributes[i].get("name"), DbUtil.getValue(rs, attributes[i]));
            }catch(Exception e){
                log.error("get result value error: " + e.getMessage() + ": " + attributes[i]);
                throw e;
            }
        }
        
        data.setInited(true);
        
        ds.add(data);    
    }
    
    //log.info("data=" + ds);
    return ds;
}finally{
    if(rs != null){
        rs.close();
    }
    if(pst != null){
        pst.close();
    }
}
#$@text#$@
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    queryOracle
    @/@actions/@queryDerby
    sname
    queryDerbyPage
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import xworker.dataObject.DataObject;
import xworker.dataObject.DataObjectList;
import xworker.dataObject.utils.DbUtil;

def pst = null;
def rs = null;
try{
    //查询总数
    def countSql = "select count(*) from (" + sql + ") as t";
    pst = con.prepareStatement(countSql);
    
    //设置查询参数
    self.doAction("setStatementParams", actionContext, ["cds":cds, "pst":pst, "attributes":attributes, "index":1]);
    rs = pst.executeQuery();
    rs.next();
    pageInfo.totalCount = rs.getInt(1);
    rs.close();
    pst.close();
    
    //分页查询
    sql = "SELECT * FROM ( SELECT ROW_NUMBER() OVER() AS rownum, t.*  FROM (" + sql + " ) t) AS tmp WHERE rownum >= ? AND rownum <= ?";
    if(self.getBoolean("showSql")){
        log.info(sql);
    }
    pst = con.prepareStatement(sql);
    self.doAction("setStatementParams", actionContext, ["cds":cds, "pst":pst, "attributes":attributes, "index":1]);
    if(pageInfo != null && pageInfo.limit != 0){
        def index = cds.size() + 1;
        def start = pageInfo.start + 1;
        pst.setInt(index, start);
        pst.setInt(index + 1, start + pageInfo.limit - 1);
    }
    
    //执行sql
    rs = pst.executeQuery();
    def ds =[];
    attributes = self.get("attribute@"); //取查询数据对象实际的列
    while(rs.next()){
        //构造对象
        def data = new DataObject(self);
        data.setInited(false);
        
        //设置属性值
        for(int i=0; i<attributes.size(); i++){
            if(!attributes[i].getBoolean("dataField")){
                continue;
            }
            data.put(attributes[i].get("name"), DbUtil.getValue(rs, attributes[i]));
        }
        
        data.setInited(true);
        
        ds.add(data);    
    }
    
    return ds;
}finally{
    if(rs != null){
        rs.close();
    }
    if(pst != null){
        pst.close();
    }
}
#$@text#$@
    sinterpretationType
    Action
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    queryDerby
    @/@actions/@queryMysql
    sname
    queryMysqlPage
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import xworker.dataObject.DataObject;
import xworker.dataObject.DataObjectList;
import xworker.dataObject.utils.DbUtil;

def pst = null;
def rs = null;
try{
    //查询总数
    def countSql = "select count(*) from (" + sql + ") as t";
    pst = con.prepareStatement(countSql);
    
    //设置查询参数
    self.doAction("setStatementParams", actionContext, ["cds":cds, "pst":pst, "attributes":attributes, "index":1]);
    rs = pst.executeQuery();
    rs.next();
    pageInfo.totalCount = rs.getInt(1);
    rs.close();
    pst.close();
    
    //分页查询
    sql = sql + " limit ? ,?";
    if(self.getBoolean("showSql")){
        log.info(sql);
    }
    pst = con.prepareStatement(sql);
    self.doAction("setStatementParams", actionContext, ["cds":cds, "pst":pst, "attributes":attributes, "index":1]);
    if(pageInfo != null && pageInfo.limit != 0){
        def index = cds.size() + 1;
        def start = pageInfo.start + 1;
        pst.setInt(index, start-1);
        pst.setInt(index + 1, start + pageInfo.limit - 2);
    }
    
    //执行sql
    rs = pst.executeQuery();
    def ds =[];
    attributes = self.get("attribute@"); //取查询数据对象实际的列
    while(rs.next()){
        //构造对象
        //log.info("data");
        def data = new DataObject(self);
        data.setInited(false);
        
        //设置属性值
        def attrs = self.get("attribute@"); //不用attribues，因统计查询的结果列和条件列可以是不一致的
        for(int i=0; i<attrs.size(); i++){
            if(!attrs[i].getBoolean("dataField")){
                continue;
            }
            data.put(attrs[i].get("name"), DbUtil.getValue(rs, attrs[i]));
        }
        
        data.setInited(true);
        
        ds.add(data);    
    }
    
    return ds;
}finally{
    if(rs != null){
        rs.close();
    }
    if(pst != null){
        pst.close();
    }
}
#$@text#$@
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    queryMysql
    @/@actions/@querySqlServer2005Page
    sname
    querySqlServer2005Page
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import xworker.dataObject.DataObject;
import xworker.dataObject.DataObjectList;
import xworker.dataObject.utils.DbUtil;

def pst = null;
def rs = null;
try{
    //查询总数
    def countSql = "select count(*) from (" + sql + ") ";
    pst = con.prepareStatement(countSql);
    
    //设置查询参数
    self.doAction("setStatementParams", actionContext, ["cds":cds, "pst":pst, "attributes":attributes, "index":1]);
    rs = pst.executeQuery();
    rs.next();
    pageInfo.totalCount = rs.getInt(1);
    rs.close();
    pst.close();
    
    //分页查询
    sql = "select * from (select t.*, ROW_NUMBER() over(order by (select 0)) as rowno from (" + sql + ") t ) where rowno between ? and ?";
    if(self.getBoolean("showSql")){
        log.info(sql);
    }
    pst = con.prepareStatement(sql);
    self.doAction("setStatementParams", actionContext, ["cds":cds, "pst":pst, "attributes":attributes, "index":1]);
    if(pageInfo != null && pageInfo.limit != 0){
        def index = cds.size() + 1;
        def start = pageInfo.start + 1;
        pst.setInt(index, start);
        pst.setInt(index + 1, start + pageInfo.limit - 1);
    }
    
    //执行sql
    rs = pst.executeQuery();
    def ds =[];
    attributes = self.get("attribute@"); //取查询数据对象实际的列
    while(rs.next()){
        //构造对象
        def data = new DataObject(self);
        data.setInited(false);
        
        //设置属性值
        for(int i=0; i<attributes.size(); i++){
            if(!attributes[i].getBoolean("dataField")){
                continue;
            }
            
            try{
                data.put(attributes[i].get("name"), DbUtil.getValue(rs, attributes[i]));
            }catch(Exception e){
                log.error("get result value error: " + e.getMessage() + ": " + attributes[i]);
                throw e;
            }
        }
        
        data.setInited(true);
        
        ds.add(data);    
    }
    
    //log.info("data=" + ds);
    return ds;
}finally{
    if(rs != null){
        rs.close();
    }
    if(pst != null){
        pst.close();
    }
}
#$@text#$@
    sinterpretationType
    Action
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sth_createIndex
    false
    sth_mark
    false
    sid
    querySqlServer2005Page
    @/@actions/@menu_reverse
    sname
    menu_reverse
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;
import java.sql.Types;

def shell = event.widget.display.activeShell;
def self = currentThing;
def dataSource = world.getThing(self.dataSource);
if(dataSource == null){
    def box = new MessageBox(shell, SWT.NONE);
    box.setText("操作信息");
    box.setMessage("数据源不存在！");
    box.open();
    return;
}

if(self.tableName == null || self.tableName == ""){
    def box = new MessageBox(shell, SWT.NONE);
    box.setText("操作信息");
    box.setMessage("没有设置表名！");
    box.open();
    return;
}

def columnMThing = world.getThing("xworker.lang.db.jdbc.metadata.Columns");
def columns = columnMThing.doAction("query", actionContext, ["dataSource":dataSource, "tableNamePattern": self.tableName.toUpperCase()]);
for(column in columns){
    switch(column.dataType){
        case Types.ARRAY_LOCATOR:
            break;
        case Types.BIGINT:
            break;
        case Types.BINARY:
            break;
        case Types.BIT:
            break;
        case Types.BLOB_LOCATOR:
            break;
        case Types.CHAR:
            break;
        case Types.CLOB_LOCATOR:
            break;
        case Types.DATE:
            break;
        case Types.DECIMAL:
            break;
        case Types.DISTINCT:
            break;
        case Types.DOUBLE:
            break;
        case Types.FLOAT:
            break;
        case Types.INTEGER:
            break;
        case Types.JAVA_OBJECT:
            break;
        case Types.LONGVARBINARY:
            break;
        case Types.LONGVARCHAR:
            break;
        case Types.NULL:
            break;
        case Types.NUMERIC:
            break;
        case Types.OTHER:
            break;
        case Types.REAL:
            break;
        case Types.REF:
            break;
        case Types.SMALLINT:
            break;
        case Types.STRUCT:
            break;
        case Types.STRUCT_LOCATOR:
            break;
        case Types.TIME:
            break;
        case Types.TIMESTAMP:
            break;
        case Types.TINYINT:
            break;
        case Types.VARBINARY:
            break;
        case Types.VARCHAR:
            break;
    }
    println column.columnName;
}
#$@text#$@
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    menu_reverse
    @/@actions/@toHibernate
    sname
    toHibernate
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.xmeta.Thing;

//Category
def thing = new Thing("xworker.hibernate.hibernate-mapping");
thing.set("name", self.name);

//Class-entity
def cls = new Thing("xworker.hibernate.hibernate-mapping/@class");
cls.set("entity-name", self.name);
cls.set("table", self.tableName);

//id
for(attr in self.get("attribute@")){
    if(attr.getBoolean("dataField") == false){
        continue;
    }
    
    if(attr.getBoolean("key")){
        def id = new Thing("xworker.hibernate.hibernate-mapping-nodes.class/@id");
        id.set("name", attr.name);
        id.set("column", attr.fieldName);
        id.set("type", getType(attr.type));
        id.set("length", attr.length);        
        if(attr.getStringBlankAsNull("generator") != null){
            def gen = new Thing("xworker.hibernate.hibernate-mapping-nodes.id/@generator");
            gen.set("class", attr.generator);
            id.addChild(gen);
        }
        cls.addChild(id);
    }
}

//attribute
for(attr in self.get("attribute@")){
    if(attr.getBoolean("dataField") == false){
        continue;
    }
    
    if(!attr.getBoolean("key")){
        def property = new Thing("xworker.hibernate.hibernate-mapping-nodes.class/@property");
        property.set("name", attr.name);
        property.set("column", attr.fieldName);
        property.set("type", getType(attr.type));
        property.set("length", attr.length);
        property.set("precision", attr.precision);
        property.set("index", attr.index);
        property.set("unique-key", attr.getString("unique-key"));
        cls.addChild(property);
    }
}    

thing.addChild(cls);
return thing;

def getType(type){
    if(type == "datetime"){
        return "timestamp";
    }else{
        return type;
    }
}
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    toHibernate
    @/@actions/@isMappingAble
    sname
    isMappingAble
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
if(actionContext.get("con") == null || con == null){
    throw new Exception("获取不到数据库连接，数据源不存在或没有正确设置。");
}

return true;
#$@text#$@
    Sdescription
#$@text#$@
<p>返回属性是否可以映射，比如数据库数据对象、CSV数据对象和Excel等数据对象的属性适合表字段、CSV或Excel的列映射的。</p>
<p>如果不能映射，直接抛出有说明文字的异常。</p>
<p>映射用于快速编辑属性。</p>
#$@text#$@
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    isMappingAble
      @/@actions/@isMappingAble/@contexts
      sname
      contexts
      slabel
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sid
      contexts
        @/@actions/@isMappingAble/@contexts/@dataSource
        sname
        dataSource
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        self.dataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
        sid
        dataSource
    @/@actions/@getMappingFields
    sname
    getMappingFields
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import xworker.dataObject.DataObject;

import ognl.Ognl;

//获取全部的表
def datas = [];
def metadata = con.getMetaData();
def rs = metadata.getColumns(null, null, self.tableName, null);
getColumns(rs, datas);
if(datas.size() == 0){
    //转化为大写重新读一次，比如oracle数据库有时表名是小写读不出来，大写可以
    rs = metadata.getColumns(null, null, self.tableName.toUpperCase(), null);
    getColumns(rs, datas);
}
if(datas.size() == 0){
    //转化为小写重新读一次
    rs = metadata.getColumns(null, null, self.tableName.toLowerCase(), null);
    getColumns(rs, datas);
}

return datas;

def getColumns(rs, columns){
    try{    
        while(rs.next()){
            def data = [:];
            data.put("colName", rs.getString("COLUMN_NAME"));
            data.put("colTitle", rs.getString("REMARKS"));
           
            columns.add(data);
        }
    }finally{
        rs.close();
    }
}
#$@text#$@
    sinterpretationType
    Action
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    getMappingFields
      @/@actions/@getMappingFields/@contexts
      sname
      contexts
      slabel
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sid
      contexts
        @/@actions/@getMappingFields/@contexts/@dataSource
        sname
        dataSource
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        self.dataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
        sid
        dataSource
    @/@actions/@getMappingAttributeName
    sname
    getMappingAttributeName
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    scode
    return "fieldName";
    sinterpretationType
    Action
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    getMappingAttributeName
    @/@actions/@getAttributeDescriptor
    sname
    getAttributeDescriptor
    stype
    string
    svalue
    xworker.dataObject.db.DbDataObject/@attribute
    sinterpretationType
    Self
    svarScope
    Local
    sdescriptors
    xworker.lang.actions.Actions/@ValueFactory
    sid
    getAttributeDescriptor
    @/@actions/@setStatementParams
    sname
    setStatementParams
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.dataObject.db.DbDataObject
    smethodName
    setStatementParams
    sdisableGlobalContext
    false
    sdescriptors
    xworker.lang.actions.Actions/@JavaAction
    sth_createIndex
    false
    sid
    setStatementParams
      @/@actions/@setStatementParams/@ins
      sisValidate
      false
      sname
      ins
      slabel
      ins
      sdescriptors
      xworker.lang.actions.Inout/@ins
      sid
      ins
        @/@actions/@setStatementParams/@ins/@cds
        sname
        cds
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescription
        <p>查询条件列表</p>
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        cds
        @/@actions/@setStatementParams/@ins/@attributes
        sname
        attributes
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescription
        <p>属性列表</p>
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        attributes
        @/@actions/@setStatementParams/@ins/@pst
        sname
        pst
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescription
        <p>SQL Statement.</p>
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        pst
        @/@actions/@setStatementParams/@ins/@index
        sname
        index
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescription
        <p>起始序号。</p>
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        index
    @/@actions/@mapping2ddl
    sname
    mapping2ddl
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.dataObject.db.DbDataObject
    smethodName
    mapping2ddl
    sdisableGlobalContext
    false
    sattributeTemplate
    false
    sinterpretationType
    Action
    svarScope
    Global
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@JavaAction
    sth_createIndex
    false
    sth_mark
    false
    sid
    mapping2ddl
    @/@actions/@menu_hibernateDDL
    sname
    menu_hibernateDDL
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    suseOuterJava
    true
    souterClassName
    xworker.dataObject.db.DbDataObject
    smethodName
    menu_hibernateDDL
    sdisableGlobalContext
    false
    sattributeTemplate
    false
    sinterpretationType
    Action
    svarScope
    Global
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@JavaAction
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    menu_hibernateDDL
  @/@tableName
  sname
  tableName
  slabel
  表名
  sinputtype
  openWindow
  ssize
  40
  scolspan
  2
  sgroup
  DB
  sinputattrs
  xworker.swt.dataObject.SelectDBTableNameDialog/@shell
  sreadOnly
  false
  sinheritDescription
  false
  svalidateAllowBlank
  true
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  tableName
  @/@dbConfigPath
  sname
  dataSource
  slabel
  数据源
  sinputtype
  openWindow
  ssize
  60
  scolspan
  2
  sgroup
  DB
  sshowLabel
  true
  sinputattrs
  xworker.swt.xworker.attributeEditor.openWins.SelectThingOpenWindow/@shell|descriptor=xworker.dataObject.datastax.Session,returnType=path
  sreadOnly
  false
  sinheritDescription
  false
  svalidateAllowBlank
  true
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  snotXmlAttribute
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  dbConfigPath
  @/@showSql
  sname
  showSql
  sinputtype
  truefalse
  sgroup
  DB
  sdefault
  false
  sinheritDescription
  false
  sdescription
  <p>是否显示SQL语句。</p>
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  showSql
  @/@querySqlForQueryOnly
  sname
  querySqlForQueryOnly
  slabel
  查询 SQL只为查询
  sinputtype
  truefalse
  sgroup
  DB
  sreadOnly
  false
  sdefault
  false
  sinheritDescription
  false
  sdescription
  <p>查询SQL是否只是在查询中使用。</p>
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sth_createIndex
  false
  sth_mark
  false
  sid
  querySqlForQueryOnly
  @/@querySql
  sname
  querySql
  slabel
  查询SQL
  sinputtype
  textarea
  scolspan
  2
  sgroup
  DB
  sreadOnly
  false
  sinheritDescription
  false
  sdescription
  <p>如果表名不存在，可以吃用查询SQL（一般是子查询）作为查询的表。</p>
  svalidateAllowBlank
  true
  LvalidateOnBlur
  false
  LallowDecimals
  false
  LallowNegative
  false
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sid
  querySql
  @/@description
  sname
  description
  sinputtype
  html
  sgroup
  DB
  sshowLabel
  true
  sreadOnly
  false
  sinheritDescription
  false
  svalidateAllowBlank
  true
  LvalidateOnBlur
  true
  LallowDecimals
  true
  LallowNegative
  true
  sdescriptors
  xworker.lang.MetaDescriptor3/@attribute
  sth_createIndex
  false
  sth_mark
  false
  sid
  description
  @/@attribute
  sname
  attribute
  slabel
  属性
  sdescriptors
  xworker.lang.MetaDescriptor3/@thing
  sextends
  xworker.dataObject.Attribute
  sid
  attribute
    @/@attribute/@name
    sname
    name
    sgroup
    Attribute
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sid
    name
    @/@attribute/@label
    sname
    label
    sgroup
    Attribute
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sid
    label
    @/@attribute/@fieldName
    sname
    fieldName
    slabel
    字段名
    ssize
    60
    scolspan
    2
    sgroup
    Attribute
    sreadOnly
    false
    sinheritDescription
    false
    sdescription
    <p>对应数据库中的字段名，如果没有那么数据库的字段名默认为属性名。</p>
    svalidateAllowBlank
    true
    LvalidateOnBlur
    false
    LallowDecimals
    false
    LallowNegative
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sid
    fieldName
    @/@attribute/@sql
    sname
    sql
    sinputtype
    textarea
    sgroup
    Attribute
    sinputattrs
    codeName= codeType= wrap=false fillBoth=true cols= rows=80
    sreadOnly
    false
    sinheritDescription
    false
    sdescription
    <p>如果不为空一般在查询时使用该sql替代字段名。</p>
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_mark
    false
    sid
    sql
    @/@attribute/@index
    sname
    index
    ssize
    40
    sgroup
    Hibernate-DDL
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    index
    @/@attribute/@unique-key
    sname
    unique-key
    slabel
    unique-key
    sgroup
    Hibernate-DDL
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    false
    LallowDecimals
    false
    LallowNegative
    false
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sid
    unique-key
    @/@attribute/@generator
    sname
    generator
    sinputtype
    select
    sgroup
    Hibernate-DDL
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    generator
      @/@attribute/@generator/@native
      sname
      native
      slabel
      native
      svalue
      native
      sdescriptors
      xworker.lang.MetaDescriptor3/@attribute/@value
      sid
      native
  @/@thing
  sname
  thing
  slabel
  事物
  sdescriptors
  xworker.lang.MetaDescriptor3/@thing
  sextends
  xworker.dataObject.RelationDataObject
  sid
  thing
  @/@actions1
  sname
  actions
  slabel
  Actions
  sdescriptors
  xworker.lang.MetaDescriptor2/@thing
  sextends
  xworker.lang.actions.Actions
  sid
  actions1
    @/@actions1/@name
    sname
    name
    sdescriptors
    xworker.lang.MetaDescriptor2/@attribute
    sid
    name
  @/@sswtMenus
  sname
  sswtMenus
  slabel
  sswtMenus
  sdescriptors
  xworker.lang.MetaDescriptor3/@swtMenus
  sid
  sswtMenus
    @/@sswtMenus/@menuDefine
    sname
    menuDefine
    slabel
    menuDefine
    sdescriptors
    xworker.lang.MetaDescriptor3/@swtMenus/@menuDefine
    sid
    menuDefine
      @/@sswtMenus/@menuDefine/@dataObject
      sname
      dataObject
      slabel
      数据对象
      sdescriptors
      xworker.lang.ThingMenu/@menuDefine/@menu
      sid
      dataObject
    @/@sswtMenus/@dataObject
    sname
    dataObject
    stype
    data
    smenuType
    dataObject
    slabel
    dataObject
    sdescriptors
    xworker.lang.MetaDescriptor3/@swtMenus/@menuSetting
    sid
    dataObject
      @/@sswtMenus/@dataObject/@editData
      sname
      editData
      slabel
      编辑数据
      surl
      xworker.dataObject.DataObject/@actions/@menu_editData
      sisSplit
      false
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sid
      editData
      @/@sswtMenus/@dataObject/@split1
      sname
      split1
      sisSplit
      true
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sid
      split1
      @/@sswtMenus/@dataObject/@quickEditItem
      sname
      quickEditItem
      slabel
      映射属性
      sshell
      xworker.swt.dataObject.AttributeMappingEditor/@shell
      sisSplit
      false
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sid
      quickEditItem
      @/@sswtMenus/@dataObject/@split2
      sname
      split2
      sisSplit
      true
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sid
      split2
      @/@sswtMenus/@dataObject/@queryStaticMenu
      sname
      queryStaticMenu
      slabel
      添加属性
      sisSplit
      false
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sid
      queryStaticMenu
        @/@sswtMenus/@dataObject/@queryStaticMenu/@importGrupAndAggrigate
        sname
        importAttribute
        slabel
        从数据对象导入属性
        sshell
        xworker.swt.dataObject.ImportAttributeDialog/@shell
        sisSplit
        false
        sattachParam
        true
        sdescriptors
        xworker.lang.Menu/@menu
        sid
        importGrupAndAggrigate
      @/@sswtMenus/@dataObject/@split3
      sname
      split3
      sisSplit
      true
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sth_createIndex
      false
      sid
      split3
      @/@sswtMenus/@dataObject/@SQL
      sname
      SQL
      sisSplit
      false
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sth_createIndex
      false
      sid
      SQL
        @/@sswtMenus/@dataObject/@SQL/@generateSimpleSql
        sname
        generateSimpleSql
        slabel
        生成简单SQL
        sshell
        xworker.swt.dataObject.GenerateSimpleSQLDialog
        sisSplit
        false
        sattachParam
        true
        sdescriptors
        xworker.lang.Menu/@menu
        sth_createIndex
        false
        sid
        generateSimpleSql
      @/@sswtMenus/@dataObject/@split4
      sname
      split4
      sisSplit
      true
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sth_createIndex
      false
      sth_mark
      false
      sid
      split4
      @/@sswtMenus/@dataObject/@Java
      sname
      Java
      sisSplit
      false
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sth_createIndex
      false
      sth_mark
      false
      sid
      Java
        @/@sswtMenus/@dataObject/@Java/@toJavaModel
        sname
        toJavaModel
        slabel
        生成JavaModel
        surl
        xworker.dataObject.DataObject/@actions/@menu_toJavaModel
        sisSplit
        false
        sattachParam
        true
        sdescriptors
        xworker.lang.Menu/@menu
        sth_createIndex
        false
        sth_mark
        false
        sid
        toJavaModel
      @/@sswtMenus/@dataObject/@split5
      sname
      split5
      sisSplit
      true
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      split5
      @/@sswtMenus/@dataObject/@DDL
      sname
      DDL
      sisSplit
      false
      sattachParam
      true
      sdescriptors
      xworker.lang.ThingMenu/@menuSetting/@menu
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      DDL
        @/@sswtMenus/@dataObject/@DDL/@hibernateDDL
        sname
        hibernateDDL
        slabel
        使用Hibernate执行DDL
        surl
        xworker.dataObject.db.DbDataObject/@actions/@menu_hibernateDDL
        sisSplit
        false
        sattachParam
        true
        sdescriptors
        xworker.lang.Menu/@menu
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        hibernateDDL
