本文整理匯總了Golang中github.com/mikeshimura/dbflute/log.InternalDebug函數的典型用法代碼示例。如果您正苦於以下問題:Golang InternalDebug函數的具體用法?Golang InternalDebug怎麽用?Golang InternalDebug使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了InternalDebug函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: getPropertyValue
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
}
示例2: apply
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
}
示例3: accept
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
}
示例4: ToBindClause
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
}
示例5: execute
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
}
示例6: doAcceptByEvaluator
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
}
示例7: Execute
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
}
示例8: processOneProperty
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
}
示例9: BuildBindClause
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
}
示例10: Execute
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)
}
示例11: SetupVaryingValue
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
}
示例12: newBasicParameterHandler
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
}
示例13: PrepareStatement
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
}
示例14: BuildBindClauseOrIsNull
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
}
示例15: ResolveBindClause
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)
}