func getPropertyValue(value interface{}, ctype string, currentName string) (string, interface{}) {
	log.InternalDebug(fmt.Sprintf("value  getPropertyValue %v %T %s\n", value, value, currentName))
	xtype := GetType(value)
	log.InternalDebug("xtype:" + xtype)
	v := reflect.ValueOf(value).Elem()
	log.InternalDebug(fmt.Sprintf("new v %v %T\n", v, v))
	newv := v.FieldByName(InitCap(currentName))
	log.InternalDebug(fmt.Sprintf("newv  %v \n", newv))
	if newv.IsValid() == false {
		fmt.Printf("value  %v %T\n", value, value)
		fmt.Println("method" + InitCap(currentName))
		test2 := reflect.ValueOf(value).MethodByName(InitCap(currentName))
		if test2.IsValid() == false {
			test2 = reflect.ValueOf(value).MethodByName("Get" + InitCap(currentName))
			if test2.IsValid() == false {
				return "", nil
			}
		}
		nValuex := test2.Call([]reflect.Value{})
		nValue := nValuex[0].Interface()
		nType := GetType(nValue)
		return nType, nValue
	}
	newValue := newv.Interface()
	newType := GetType(newValue)

	return newType, newValue
}
func (t *TnAbstractTwoWaySqlCommand) apply(rootNode *Node, args []interface{}, argNames []string, argTypes []string) *CommandContext {
	log.InternalDebug("TnAbstractTwoWaySqlCommand apply")
	log.InternalDebug(fmt.Sprintf("argNames %v argtypes %v \n", argNames, argTypes))
	//fmt.Printf("rootNode %v  \n", rootNode)
	ctx := t.createCommandContext(args, argNames, argTypes)
	(*rootNode).accept(ctx, rootNode)
	//fmt.Println("sql apply %s"+(*ctx).getSql())
	return ctx
}
func (r *SqlPartsNode) accept(ctx *CommandContext, node *Node) {
	log.InternalDebug("SqlPartsNode accept")
	(*ctx).addSql(r.sqlParts)
	log.InternalDebug("SQL PART*" + r.sqlParts)
	//以下未実装
	//        if (isMarkAlreadySkipped(ctx)) {
	//            // It does not skipped actually but it has not already needed to skip.
	//            ctx.setAlreadySkippedConnector(true);
	//        }
	return
}
func (b *BindClauseResult) ToBindClause() string {
	var clause string
	//Temporary for T/S
	//	if b.Arranger != nil {
	//		clause = (*b.Arranger).Arrange(b.ColumnExp, b.Operand, b.BindExp, b.RearOption)
	//	} else {
	clause = b.ColumnExp.ToString() + " " + b.Operand + " " +
		b.BindExp + b.RearOption
	//	}
	log.InternalDebug("operand :" + b.Operand)
	log.InternalDebug("clause:" + clause)
	log.InternalDebug("bindExp :" + b.BindExp)
	log.InternalDebug("clause :" + clause)
	return clause
}
func (t *TnBasicSelectHandler) execute(bindVariables *List, bindVariableTypes *StringList, tx *sql.Tx, behavior *Behavior) interface{} {
	dbc := (*(*behavior).GetBaseBehavior().GetBehaviorCommandInvoker().InvokerAssistant).GetDBCurrent()

	ps := (*t.statementFactory).PrepareStatement(t.sql, tx, dbc)
	defer ps.Close()
	bindVar := (*t.statementFactory).ModifyBindVariables(bindVariables, bindVariableTypes)
	//ps := t.prepareStatement(tx, dbc)
	//	ns:=new(sql.NullString)
	//	ns.Valid=true
	//	ns.String="2"
	//	var itest interface{}=ns
	t.logSql(bindVariables, bindVariableTypes)
	var rows *sql.Rows
	var err error
	if bindVariables == nil {
		rows, err = tx.Stmt(ps).Query()
		if err != nil {
			panic(err.Error())
		}
	} else {
		rows, err = tx.Stmt(ps).Query(bindVar.data...)
		if err != nil {
			panic(err.Error())
		}
	}

	log.InternalDebug(fmt.Sprintln("ResultType:", t.ResultType))
	rh := new(ResultSetHandler)
	//l := BhvUtil_I.GetListResultBean(rows, t.ResultType,t.SqlClause)
	l := rh.GetListResultBean(rows, t.ResultType, t.SqlClause)
	log.InternalDebug(fmt.Sprintln("result no:", l.List.Size()))
	log.InternalDebug(fmt.Sprintf("data %v\n", l.List.Get(0)))
	//        logSql(args, argTypes);
	//        PreparedStatement ps = null;
	//        try {
	//            ps = prepareStatement(conn);
	//            bindArgs(conn, ps, args, argTypes);
	//            return queryResult(ps);
	//        } catch (SQLException e) {
	//            final SQLExceptionResource resource = createSQLExceptionResource();
	//            resource.setNotice("Failed to execute the SQL for select.");
	//            handleSQLException(e, resource);
	//            return null; // unreachable
	//        } finally {
	//            close(ps);
	//        }
	return l
}
func (r *IfNode) doAcceptByEvaluator(ctx *CommandContext, loopInfo *LoopInfo) {
	cmap := (*ctx).GetArgs()
	cmap = cmap
	//fmt.Printf("ctx %v \n", len(cmap))
	evaluator := new(IfCommentEvaluator)
	f := new(ParameterFinderArg)
	var finder ParameterFinder = f
	evaluator.finder = &finder
	evaluator.ctx = ctx
	evaluator.expression = r.expression
	evaluator.specifiedSql = r.specifiedSql
	result := evaluator.evaluate()
	log.InternalDebug(fmt.Sprintf("Else node %v\n", r.elseNode))
	if result {
		r.processAcceptingChildren(ctx, loopInfo)
		(*ctx).setEnabled(true)
	} else if r.elseNode != nil {
		//            if (loopInfo != null) {
		//                _elseNode.accept(ctx, loopInfo);
		//            } else {
		var node Node = r.elseNode
		r.elseNode.accept(ctx, &node)
		//            }
	}
	return
}
func (p *TnCommandContextHandler) Execute(args []interface{}, tx *sql.Tx, behavior *Behavior) interface{} {

	p.sql = (*p.CommandContext).getSql()
	//	fmt.Printf("getBindVariables %v\n",(*p.CommandContext).getBindVariables())
	//	p.logSql((*p.CommandContext).getBindVariables(),
	//		(*p.CommandContext).getBindVariableTypes())
	//	log.Flush()
	//	fmt.Printf("statementFactory %v \n",p.statementFactory)
	bindVariables := (*p.CommandContext).getBindVariables()
	bindVariableTypes := (*p.CommandContext).getBindVariableTypes()
	dbc := (*(*behavior).GetBaseBehavior().GetBehaviorCommandInvoker().InvokerAssistant).GetDBCurrent()

	ps := (*p.statementFactory).PrepareStatement(p.sql, tx, dbc)
	defer ps.Close()
	bindVar := (*p.statementFactory).ModifyBindVariables(bindVariables, bindVariableTypes)
	p.logSql(bindVariables, bindVariableTypes)
	log.Flush()
	res, err := tx.Stmt(ps).Exec(bindVar.data...)
	if err != nil {
		panic(err.Error())
	}

	updateno, _ := res.RowsAffected()
	log.InternalDebug(fmt.Sprintln("result no:", updateno))
	return updateno
}
func (i *IfCommentEvaluator) processOneProperty(baseObject interface{}, preProperty string, property string) interface{} {
	if baseObject == nil {
		panic("Null Oblect found:" + preProperty)
	}
	v := reflect.ValueOf(baseObject).Elem()
	log.InternalDebug(fmt.Sprintf("pmb new v %v %T\n", v, v))
	newv := v.FieldByName(InitCap(property))
	log.InternalDebug(fmt.Sprintf("newv  %v \n", newv))
	if newv.IsValid() == false {
		//どちらが良いか要検討
		//return "string", ""
		return nil
	}
	newValue := newv.Interface()
	return newValue
}
func (w *BaseConditionKey) BuildBindClause(columnRealName *ColumnRealName,
	loc string, co *ConditionOption) *QueryClause {
	sqc := CreateStringQueryClause(w.DoBuildBindClause(columnRealName, loc, co))
	var qc QueryClause = sqc
	log.InternalDebug(fmt.Sprintf(" QueryClause %v \n", qc))
	return &qc
}
func (t *TnUpdateEntityDynamicCommand) Execute(args []interface{}, tx *sql.Tx, behavior *Behavior) interface{} {
	if args == nil || len(args) == 0 {
		panic("The argument 'args' should not be null or empty.")
	}
	bean := args[0]
	var option *UpdateOption = (args[1]).(*UpdateOption)
	//未実装
	//        final UpdateOption<ConditionBean> option = extractUpdateOptionChecked(args);
	//        prepareStatementConfigOnThreadIfExists(option);
	//
	//        final TnPropertyType[] propertyTypes = createUpdatePropertyTypes(bean, option);
	var entity *Entity = bean.(*Entity)
	propertyTypes := t.createUpdatePropertyTypes(entity, nil)
	if propertyTypes.Size() == 0 {
		//        if (propertyTypes.length == 0) {
		//            if (isLogEnabled()) {
		//                log(createNonUpdateLogMessage(bean));
		//            }
		//            return getNonUpdateReturn();
		//        }
		return 1
	}
	sql := t.createUpdateSql(propertyTypes, option)
	log.InternalDebug(fmt.Sprintln("sql :" + sql))
	sql2 := t.filterExecutedSql(sql)
	return t.doExecute(entity, propertyTypes, sql2, option, tx)
}
func (w *ConditionValue) SetupVaryingValue(cond *ConditionKey, value interface{}) string {
	if w.Varying == nil {
		log.InternalDebug("Varying created:")
		w.Varying = make(map[string]map[string]interface{})
	}
	key := (*cond).GetConditionKeyS()
	log.InternalDebug("GetConditionKeyS  :" + key)
	var elementMap map[string]interface{} = w.Varying[key]
	if elementMap == nil {
		elementMap = make(map[string]interface{})
		w.Varying[key] = elementMap
	}
	elementkey := key + strconv.Itoa(len(elementMap))
	elementMap[elementkey] = value
	return "Varying." + key + "." + elementkey
}
func (o *OutsideSqlSelectExecution) newBasicParameterHandler(executedSql string) *ParameterHandler {
	handler := new(TnBasicSelectHandler)
	handler.sql = executedSql
	handler.statementFactory = o.StatementFactory
	log.InternalDebug(fmt.Sprintln("o.ResultType:", o.ResultType))
	handler.ResultType = o.ResultType
	var hand ParameterHandler = handler
	return &hand
}
Exemple #13
0
func (t *TnStatementFactoryImpl) PrepareStatement(orgSql string, tx *sql.Tx,
	dbc *DBCurrent) *sql.Stmt {
	sql := t.modifySql(orgSql, dbc)
	log.InternalDebug(fmt.Sprintf("sql %s \ntx %v %T\n", sql, tx, tx))
	stmt, errs := tx.Prepare(sql)
	if errs != nil {
		panic(errs.Error() + ":" + sql)
	}
	return stmt
}
func (w *BaseConditionKey) BuildBindClauseOrIsNull(columnRealName *ColumnRealName,
	loc string, co *ConditionOption) *QueryClause {
	mainQuery := w.DoBuildBindClause(columnRealName, loc, co)
	clause := "(" + mainQuery + " or " + columnRealName.ToString() + " is null)"
	sqc := new(StringQueryClause)
	sqc.Clause = clause
	var qc QueryClause = sqc
	log.InternalDebug(fmt.Sprintf(" QueryClause %v \n", qc))
	return &qc
}
func (w *BaseConditionKey) ResolveBindClause(columnRealName *ColumnRealName,
	loc string, co *ConditionOption) *BindClauseResult {
	var basicBindExp string
	if loc != "" {
		basicBindExp = w.BuildBindVariableExp(loc, co)
		log.InternalDebug("basicBindExp :" + basicBindExp)
	}
	resolvedColumn := w.ResolveOptionalColumn(columnRealName, co)
	return w.CreateBindClauseResult(resolvedColumn, basicBindExp, co)

}
func (r *RootNode) accept(ctx *CommandContext, node *Node) {
	for i := 0; i < r.GetChildSize(); i++ {
		inter := r.GetChild(i)
		//var node Node = *inter.(*Node)
		stype := GetType(*inter)
		log.InternalDebug(fmt.Sprintln("accept node type :" + stype))
		//node.accept(ctx)
		(*inter).accept(ctx, inter)
	}
	return
}
func (v *ValueAndTypeSetupper) setupValueAndType(valueAndType *ValueAndType) {
	value := valueAndType.firstValue
	if value == nil { // if null, do nothing
		return
	}
	ctype := valueAndType.firstType
	ctype = ctype

	// LikeSearchOption handling here is for OutsideSql.
	//未実装
	var likeSearchOption LikeSearchOption
	likeSearchOption = likeSearchOption
	//
	for pos := 1; pos < v.nameList.Size(); pos++ {
		//            if (value == null) {
		//                break;
		//            }
		if value == nil {
			break
		}
		currentName := v.nameList.Get(pos)
		ctype, value = getPropertyValue(value, ctype, currentName)
		log.InternalDebug(fmt.Sprintf("new ctype %s\n", ctype))
		log.InternalDebug(fmt.Sprintf("new value %v\n", value))
		if ctype == "map[string]map[string]interface {}" {
			var mp map[string]map[string]interface{} = value.(map[string]map[string]interface{})
			value = mp[v.nameList.Get(pos+1)][v.nameList.Get(pos+2)]
			ctype = GetType(value)
			break
		}
	}
	//未実装
	//adjustLikeSearchDBWay(likeSearchOption)
	//        valueAndType.setTargetValue(value);
	valueAndType.targetValue = value
	log.InternalDebug(fmt.Sprintf("value %v %T\n", value, value))
	//        valueAndType.setTargetType(clazz);
	valueAndType.targetType = ctype
	//未実装
	//        valueAndType.setLikeSearchOption(likeSearchOption);
}
func (w *ConditionValue) SetupNotLikeSearch(value interface{}, location string,
	co *ConditionOption) {
	if w.NotLikeSearchValueHandler == nil {
		var ck ConditionKey = CK_LS
		w.NotLikeSearchValueHandler = CreateVaryingValueHandler(w, &ck)
	}
	var v string = value.(string)
	log.InternalDebug("LikeSearch value :" + (*co).GenerateRealValue(v))
	w.NotLikeSearchLatestLocation = location + "." +
		w.NotLikeSearchValueHandler.SetValue((*co).GenerateRealValue(v))

}
func (b *BaseEntityCommand) getPersistentPropertyNames(
	dbmeta *DBMeta) *StringList {
	columnInfoList := (*dbmeta).GetColumnInfoList()
	propertyNameList := new(StringList)
	for _, columnInfo := range columnInfoList.data {
		var ci *ColumnInfo = columnInfo.(*ColumnInfo)
		propertyNameList.Add(ci.PropertyName)
	}
	log.InternalDebug(fmt.Sprintf("propertyNameList %v\n",
		propertyNameList.data))
	return propertyNameList
}
func (t *TnAbstractEntityHandler) setupUpdateBindVariables(entity *Entity) {
	//	        setupUpdateBindVariables(bean);
	//      これはTnAbstractEntityHandlerで実装
	varList := new(List)
	varList = varList
	varValueTypeList := new(StringList)
	varValueTypeList = varValueTypeList
	timestampPropertyName := ""
	timestampPropertyName = timestampPropertyName
	versionNoPropertyName := ""
	if (*(*entity).GetDBMeta()).HasVersionNo() {
		versionNoPropertyName = (*(*entity).GetDBMeta()).GetVersionNoColumnInfo().PropertyName
	}
	versionNoPropertyName = versionNoPropertyName
	for _, ptx := range t.boundPropTypes.data {
		var pt *TnPropertyType = ptx.(*TnPropertyType)
		pt = pt
		log.InternalDebug(fmt.Sprintf("PT %v\n", pt))

		//未実装
		//            if (pt.getPropertyName().equalsIgnoreCase(timestampPropertyName)) {
		//                final Timestamp timestamp = ResourceContext.getAccessTimestamp();
		//                addNewTimestamp(timestamp);
		//                varList.add(timestamp);
		//            } else if (pt.getPropertyName().equalsIgnoreCase(versionNoPropertyName)) {
		if pt.propetyName == versionNoPropertyName {
			if !t.versionNoAutoIncrementOnMemory { // means OnQuery
				continue // because of 'VERSION_NO = VERSION_NO + 1'
			}

			var versionNo int64 = *(GetEntityValue(entity, versionNoPropertyName).(*int64)) + 1
			//                final Object value = pt.getPropertyDesc().getValue(bean); // already null-checked
			//                final long longValue = DfTypeUtil.toPrimitiveLong(value) + 1L;
			//                final Long versionNo = Long.valueOf(longValue);
			if t.newVersionNoList == nil {
				t.newVersionNoList = new(List)
			}
			t.newVersionNoList.Add(versionNo)
			varList.Add(versionNo)

			//            } else if (_updateOption != null && _updateOption.hasStatement(pt.getColumnDbName())) {
			//                continue; // because of 'FOO_COUNT = FOO_COUNT + 1'
		} else {
			varList.Add(GetEntityValue(entity, pt.propetyName))
		}
		varValueTypeList.Add(pt.GoType)
		//        }
	}
	t.addAutoUpdateWhereBindVariables(varList, varValueTypeList, entity)
	t.bindVariables = varList
	t.bindVariableValueTypes = varValueTypeList
}
func (s *SqlAnalyzer) isElseMode() bool {
	//	未実装
	//	        for (int i = 0; i < _nodeStack.size(); ++i) {
	//            if (_nodeStack.get(i) instanceof ElseNode) {
	//                return true;
	//            }
	//        }
	for _, node := range s.stack.data {
		n := node.(*Node)
		log.InternalDebug(fmt.Sprintf("nodetype %v %s\n", node, (*n).stype()))
	}
	return false
}
func (t *TnAbstractEntityStaticCommand) setupDeleteSql() {
	//	        checkPrimaryKey();
	//        final StringBuilder sb = new StringBuilder(64);
	//        sb.append("delete from ").append(_targetDBMeta.getTableSqlName());
	//        setupDeleteWhere(sb);
	//        _sql = sb.toString();
	sb := new(bytes.Buffer)
	sb.WriteString("delete from " + (*t.targetDBMeta).GetTableDbName())
	t.setupDeleteWhere(sb)
	t.sql = sb.String()
	log.InternalDebug(t.sql)
	return
}
func (t *TnAbstractTwoWaySqlCommand) Execute(args []interface{}, tx *sql.Tx, behavior *Behavior) interface{} {
	log.InternalDebug("TnAbstractTwoWaySqlCommand Execute")
	//Current
	//	        final Node rootNode = getRootNode(args);
	rootNode := (*t.sqlExecution).GetRootNode(args)
	ctx := t.apply(rootNode, args, (*t.sqlExecution).GetArgNames(), (*t.sqlExecution).GetArgTypes())
	log.InternalDebug("ctx Sql :" + (*ctx).getSql())
	executedSql := (*t.sqlExecution).filterExecutedSql((*ctx).getSql())
	log.InternalDebug("executedSql :" + executedSql)
	handler := t.createBasicParameterHandler(ctx, executedSql)
	//fmt.Printf("handler %v %T\n", handler, handler)
	//fmt.Printf("behavior %v %T\n", behavior, behavior)
	bindVariables := (*ctx).getBindVariables()
	log.InternalDebug(fmt.Sprintf("bind Variables %v \n", bindVariables))
	bindVariableTypes := (*ctx).getBindVariableTypes()
	bindVariables = bindVariables
	bindVariableTypes = bindVariableTypes

	rtn := (*handler).execute(bindVariables, bindVariableTypes, tx, behavior)
	//        return filterReturnValue(handler.execute(bindVariables, bindVariableTypes));

	return rtn
}
func (s *SqlAnalyzer) Analyze() *Node {

	//	     push(createRootNode()); // root node of all
	rn := s.CreateRootNode()
	log.InternalDebug(fmt.Sprintf("AnalyzeRoot Node %v\n", rn))
	var node Node = rn
	s.Push(&node)
	//        while (SqlTokenizer.EOF != _tokenizer.next()) {
	//for TOK_EOF != s.tokenizer.Next() {
	for {
		res := s.tokenizer.Next()
		if res == TOK_EOF {
			break
		}
		s.parseToken()
	}
	//            parseToken();
	//        }
	//        return pop();
	res := s.Pop()
	log.InternalDebug(fmt.Sprintf("AnalyzeRoot End Node %v\n", res))
	return res
}
func (b *BaseConditionQuery) ToColumnRealName(
	col string, csn *ColumnSqlName) *ColumnRealName {
	var crn *ColumnRealName
	if csn != nil {
		crn = CreateColumnRealName(b.AliasName, csn)
	} else {
		dbmeta := b.xgetLocalDBMeta()
		log.InternalDebug(fmt.Sprintf("ToColumnRealName dbmeta %v \n", dbmeta))
		cno := (*dbmeta).GetColumnInfoMap()[col]
		ci := (*dbmeta).GetColumnInfoList().Get(cno)
		columnInfo := ci.(*ColumnInfo)
		crn = CreateColumnRealName(b.AliasName, columnInfo.ColumnSqlName)
	}
	return crn
}
Exemple #26
0
func (b *BaseBehavior) injectSequenceToPrimaryKeyIfNeeds(entity *Entity,
	tx *sql.Tx) {
	dbmeta := (*entity).GetDBMeta()

	if !(*dbmeta).HasSequence() || (*dbmeta).HasCompoundPrimaryKey() ||
		(*entity).HasPrimaryKeyValue() || (*dbmeta).HasIdentity() {
		return
	}
	// basically property(column) type is same as next value type
	// so there is NOT type conversion cost when writing to the entity
	col := ((*dbmeta).GetPrimaryUniqueInfo().UniqueColumnList.Get(0)).(*ColumnInfo)
	nextVal := (*b.Behavior).ReadNextVal(tx)
	log.InternalDebug("next val " + fmt.Sprintf("%v", nextVal))
	SetEntityValue(entity, col.PropertyName, nextVal)
	return
}
func (r *VariableNode) doAcceptSub(ctx *CommandContext, firstValue interface{}, firstType string, loopInfo *LoopInfo, inheritLoop bool, node *Node) {
	//        assertInLoopOnlyOptionInLoop(loopInfo);
	valueAndType := new(ValueAndType)
	valueAndType.firstValue = firstValue
	valueAndType.firstType = firstType

	r.setupValueAndType(valueAndType, node)
	//未実装
	//        processLikeSearch(valueAndType, loopInfo, inheritLoop);
	log.InternalDebug(fmt.Sprintf("blockNullParameter %v \n ", r.blockNullParameter))
	if r.blockNullParameter && IsNotNull(valueAndType.targetValue) == false {
		panic("The value of bind variable was null.")
	}
	(*node).doProcess(ctx, valueAndType, loopInfo)
	return
}
func (b *BaseConditionQuery) SetupConditionValueAndRegisterWhereClauseSub(
	key *ConditionKey, value interface{}, cvalue *ConditionValue,
	col string, co *ConditionOption) {
	dm := b.DBMetaProvider.TableDbNameInstanceMap[b.TableDbName]
	cinfo := (*dm).GetColumnInfoByPropertyName(col)
	pn := cinfo.PropertyName
	un := InitUnCap(pn)
	loc := b.XgetLocation(un)
	log.InternalDebug(fmt.Sprintln("Location :" + loc))
	(*key).SetupConditionValue(
		key, b.XcreateQueryModeProvider(), cvalue, value, loc, co)
	crn := b.ToColumnRealName(col, cinfo.ColumnSqlName)
	usedAliasName := b.AliasName
	(*b.SqlClause).RegisterWhereClause(crn, key, cvalue, co, usedAliasName)

}
func (t *TnAbstractEntityHandler) setupInsertBindVariables(entity *Entity) {
	//	        setupInsertBindVariables(bean);
	//      これはTnAbstractEntityHandlerで実装
	varList := new(List)
	varList = varList
	varValueTypeList := new(StringList)
	varValueTypeList = varValueTypeList
	timestampPropertyName := ""
	timestampPropertyName = timestampPropertyName
	versionNoPropertyName := ""
	if (*(*entity).GetDBMeta()).HasVersionNo() {
		versionNoPropertyName = (*(*entity).GetDBMeta()).GetVersionNoColumnInfo().PropertyName
	}
	versionNoPropertyName = versionNoPropertyName
	//fmt.Printf("boundPropTypes %d\n",t.boundPropTypes.Size())
	for _, ptx := range t.boundPropTypes.data {
		var pt *TnPropertyType = ptx.(*TnPropertyType)
		pt = pt
		log.InternalDebug(fmt.Sprintf("PT %v\n", pt))

		//未実装
		//            if (pt.getPropertyName().equalsIgnoreCase(timestampPropertyName)) {
		//                final Timestamp timestamp = ResourceContext.getAccessTimestamp();
		//                addNewTimestamp(timestamp);
		//                varList.add(timestamp);
		//            } else if (pt.getPropertyName().equalsIgnoreCase(versionNoPropertyName)) {
		//fmt.Printf("propetyName %s versionNoPropertyName %s\n", pt.propetyName, versionNoPropertyName)
		if pt.propetyName == versionNoPropertyName {

			var firstNo int64 = VERSION_NO_FIRST_VALUE
			if t.newVersionNoList == nil {
				t.newVersionNoList = new(List)
			}
			t.newVersionNoList.Add(firstNo)
			varList.Add(firstNo)
			//fmt.Printf("version no %d propetyName %s\n", firstNo, pt.propetyName)
		} else {
			varList.Add(GetEntityValue(entity, pt.propetyName))
		}
		varValueTypeList.Add(pt.GoType)
		//        }
	}
	t.bindVariables = varList
	t.bindVariableValueTypes = varValueTypeList
	//fmt.Printf("varList size %d %v\n",varList.Size(),varList)
	//fmt.Printf("varValueTypeList size %d\n",varValueTypeList.Size())
}
func (t *TnInsertEntityDynamicCommand) createInsertPropertyTypes(entity *Entity, option *InsertOption) *List {
	propetyNames := new(StringList)
	//dbMeta := (*entity).GetDBMeta()
	modifiedSet := t.getModifiedPropertyNames(entity)
	//fmt.Printf("ModifiedSet %v\n", modifiedSet)
	typeList := new(List)
	timestampProp := ""
	timestampProp = timestampProp
	versionNoProp := ""

	if (*(*entity).GetDBMeta()).HasVersionNo() {
		versionNoProp = (*(*entity).GetDBMeta()).GetVersionNoColumnInfo().PropertyName
		versionNoProp = versionNoProp
	}
	primaryKeyset := make(map[string]string)
	primaryKeyset = primaryKeyset
	if (*(*entity).GetDBMeta()).HasPrimaryKey() {
		primaryKeys := (*(*entity).GetDBMeta()).GetPrimaryInfo().UniqueInfo.UniqueColumnList.data
		for _, primaryKey := range primaryKeys {
			var colInfo *ColumnInfo = primaryKey.(*ColumnInfo)
			primaryKeyset[colInfo.PropertyName] = colInfo.PropertyName
		}
	}
	for _, propertyName := range t.propertyNames.data {
		_, ok := primaryKeyset[propertyName]
		if ok {
			if option == nil || !option.isPrimaryKeyIdentityDisabled() {
				if (*(*entity).GetDBMeta()).HasIdentity() {
					continue
				}
			}
			typeList.Add((*(*entity).GetDBMeta()).GetPropertyType(propertyName))
			propetyNames.Add(propertyName)
			continue
		}
		log.InternalDebug(fmt.Sprintf("propertyName %v\n", propertyName))
		//pt:=(*dbMeta).GetPropertyType(propertyName)
		if t.isOptimisticLockProperty(timestampProp, versionNoProp, propertyName) || t.isSpecifiedProperty(option, modifiedSet, propertyName) {
			// Statement
			typeList.Add((*(*entity).GetDBMeta()).GetPropertyType(propertyName))
			propetyNames.Add(propertyName)
			//fmt.Println("typeList Added :" + propertyName)
		}
	}
	t.propertyNames = propetyNames
	return typeList
}