model

package
v0.0.0-...-800783e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2016 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	DB      *database.Orm
	Context *X.Context
}

func NewModel

func NewModel(db *database.Orm, ctx *X.Context) *Model

func (*Model) Begin

func (this *Model) Begin() *xorm.Session

===================================== TransManager =====================================

func (*Model) End

func (this *Model) End(result bool, args ...*xorm.Session) (err error)

func (*Model) HasBegun

func (this *Model) HasBegun() bool

事务是否已经开始

func (*Model) NewClient

func (this *Model) NewClient(m interface{}) client.Client

func (*Model) NewSelect

func (this *Model) NewSelect(m interface{}) *Select

func (*Model) Sess

func (this *Model) Sess() *xorm.Session

func (*Model) T

func (this *Model) T(key string, args ...interface{}) string

func (*Model) TSess

func (this *Model) TSess() *xorm.Session

func (*Model) Trans

func (this *Model) Trans(fn func() error) *database.Orm

type Select

type Select struct {
	Offset    int64
	Limit     int64
	OrderBy   string
	Condition string
	Params    []interface{}
	GroupBy   string
	Having    string
	Table     interface{}
	Alias     string
	*database.Orm
	client.Client
}

func NewSelect

func NewSelect(orm *database.Orm, c client.Client) *Select

func (*Select) AddParam

func (a *Select) AddParam(args ...interface{}) *Select

func (*Select) Count

func (a *Select) Count(m interface{}) int64

func (*Select) Do

func (a *Select) Do(args ...interface{}) *xorm.Session

func (*Select) FromClient

func (a *Select) FromClient(gen bool, fields ...string) *Select

func (*Select) GenSess

func (a *Select) GenSess(args ...interface{}) *xorm.Session

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL