Documentation
¶
Index ¶
- Constants
- func Compare(src string, getFunc func(key string) string) bool
- func ParseDynamic(src string, sqls []Sql) (*parsing.DynamicData, error)
- type Choose
- type ChooseProcessor
- type Constructor
- type Delete
- type Foreach
- type ForeachProcessor
- type IdArg
- type If
- type IfProcessor
- type Include
- type IncludeProcessor
- type Insert
- type Manager
- func (manager *Manager) FindSqlParser(sqlId string) (sqlparser.SqlParser, bool)
- func (manager *Manager) RegisterData(data []byte) error
- func (manager *Manager) RegisterFile(file string) error
- func (manager *Manager) RegisterSql(sqlId string, sql string) error
- func (manager *Manager) UnregisterSql(sqlId string)
- type Mapper
- type Otherwise
- type Property
- type Result
- type ResultMap
- type Select
- type Set
- type SetProcessor
- type Sql
- type Update
- type When
- type Where
- type WhereProcessor
Constants ¶
View Source
const (
MapperStart = "mapper"
)
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
test的参数必须是使用{}包裹起来,并且比较符号需要空格分隔,如<if test="{1} != nil"> 或者 <if test="{x.name} != nil">
func ParseDynamic ¶
func ParseDynamic(src string, sqls []Sql) (*parsing.DynamicData, error)
Types ¶
type ChooseProcessor ¶
type ChooseProcessor string
func (ChooseProcessor) EndStr ¶
func (d ChooseProcessor) EndStr() string
func (ChooseProcessor) Parse ¶
func (d ChooseProcessor) Parse(src string) parsing.DynamicElement
type Constructor ¶
type Delete ¶
type Delete struct {
XMLName xml.Name
Id string `xml:"id,attr"`
ParameterType string `xml:"parameterType,attr"`
FlushCache string `xml:"flushCache,attr"`
Timeout string `xml:"timeout,attr"`
StatementType string `xml:"statementType,attr"`
//If []If `xml:"if"`
//Include Include `xml:"include"`
//Where Where `xml:"where"`
//Data string `xml:",chardata"`
Data string `xml:",innerxml"`
}
type Foreach ¶
type ForeachProcessor ¶
type ForeachProcessor string
func (ForeachProcessor) EndStr ¶
func (d ForeachProcessor) EndStr() string
func (ForeachProcessor) Parse ¶
func (d ForeachProcessor) Parse(src string) parsing.DynamicElement
type If ¶
type IfProcessor ¶
type IfProcessor string
func (IfProcessor) EndStr ¶
func (d IfProcessor) EndStr() string
func (IfProcessor) Parse ¶
func (d IfProcessor) Parse(src string) parsing.DynamicElement
type Include ¶
type IncludeProcessor ¶
type IncludeProcessor string
func (IncludeProcessor) EndStr ¶
func (d IncludeProcessor) EndStr() string
func (IncludeProcessor) Parse ¶
func (d IncludeProcessor) Parse(src string) parsing.DynamicElement
type Insert ¶
type Insert struct {
XMLName xml.Name
Id string `xml:"id,attr"`
ParameterType string `xml:"parameterType,attr"`
FlushCache string `xml:"flushCache,attr"`
Timeout string `xml:"timeout,attr"`
StatementType string `xml:"statementType,attr"`
UseGeneratedKeys string `xml:"useGeneratedKeys,attr"`
KeyProperty string `xml:"keyProperty,attr"`
KeyColumn string `xml:"keyColumn,attr"`
//If []If `xml:"if"`
//Include Include `xml:"include"`
//Where Where `xml:"where"`
//Data string `xml:",chardata"`
Data string `xml:",innerxml"`
}
type Manager ¶ added in v0.2.7
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶ added in v0.2.7
func NewManager() *Manager
func (*Manager) FindSqlParser ¶ added in v0.2.7
func (*Manager) RegisterData ¶ added in v0.2.7
func (*Manager) RegisterFile ¶ added in v0.2.7
func (*Manager) RegisterSql ¶ added in v0.2.7
func (*Manager) UnregisterSql ¶ added in v0.2.7
type Mapper ¶
type ResultMap ¶
type ResultMap struct {
XMLName xml.Name
//id
Id string `xml:"id,attr"`
//struct类型名称
TypeName string `xml:"type,attr"`
//constructor - 用于在实例化类时,注入结果到构造方法中
Constructor Constructor `xml:"constructor"`
//一个 ID 结果;标记出作为 ID 的结果可以帮助提高整体性能
ResultId Result `xml:"id"`
//注入到字段或 Struct 属性的普通结果
Results []Result `xml:"result"`
}
type Select ¶
type Select struct {
XMLName xml.Name
Id string `xml:"id,attr"`
ParameterType string `xml:"parameterType,attr"`
ParameterMap string `xml:"parameterMap,attr"`
ResultType string `xml:"resultType,attr"`
ResultMap string `xml:"resultMap,attr"`
FlushCache string `xml:"flushCache,attr"`
UseCache string `xml:"useCache,attr"`
Timeout string `xml:"timeout,attr"`
FetchSize string `xml:"fetchSize,attr"`
StatementType string `xml:"statementType,attr"`
ResultSetType string `xml:"resultSetType,attr"`
//If []If `xml:"if"`
//Include Include `xml:"include"`
//Where Where `xml:"where"`
//Data string `xml:",chardata"`
Data string `xml:",innerxml"`
}
func (*Select) ParseDynamic ¶
func (a *Select) ParseDynamic()
type SetProcessor ¶
type SetProcessor string
func (SetProcessor) EndStr ¶
func (d SetProcessor) EndStr() string
func (SetProcessor) Parse ¶
func (d SetProcessor) Parse(src string) parsing.DynamicElement
type Update ¶
type Update struct {
XMLName xml.Name
Id string `xml:"id,attr"`
ParameterType string `xml:"parameterType,attr"`
FlushCache string `xml:"flushCache,attr"`
Timeout string `xml:"timeout,attr"`
StatementType string `xml:"statementType,attr"`
//If []If `xml:"if"`
//Include Include `xml:"include"`
//Set Set `xml:"set"`
//Where Where `xml:"where"`
//Data string `xml:",chardata"`
Data string `xml:",innerxml"`
}
type WhereProcessor ¶
type WhereProcessor string
func (WhereProcessor) EndStr ¶
func (d WhereProcessor) EndStr() string
func (WhereProcessor) Parse ¶
func (d WhereProcessor) Parse(src string) parsing.DynamicElement
Click to show internal directories.
Click to hide internal directories.