Merge branch 'nemec784-fix/warnings/comment_on_exported'
This commit is contained in:
commit
a6b31eda3d
|
@ -92,7 +92,7 @@ func (m *LRUCacher) GC() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all bean's ids according to sql and parameter from cache
|
// GetIds returns all bean's ids according to sql and parameter from cache
|
||||||
func (m *LRUCacher) GetIds(tableName, sql string) interface{} {
|
func (m *LRUCacher) GetIds(tableName, sql string) interface{} {
|
||||||
m.mutex.Lock()
|
m.mutex.Lock()
|
||||||
defer m.mutex.Unlock()
|
defer m.mutex.Unlock()
|
||||||
|
@ -121,7 +121,7 @@ func (m *LRUCacher) GetIds(tableName, sql string) interface{} {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get bean according tableName and id from cache
|
// GetBean returns bean according tableName and id from cache
|
||||||
func (m *LRUCacher) GetBean(tableName string, id string) interface{} {
|
func (m *LRUCacher) GetBean(tableName string, id string) interface{} {
|
||||||
m.mutex.Lock()
|
m.mutex.Lock()
|
||||||
defer m.mutex.Unlock()
|
defer m.mutex.Unlock()
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
|
|
||||||
var _ core.CacheStore = NewMemoryStore()
|
var _ core.CacheStore = NewMemoryStore()
|
||||||
|
|
||||||
// memory store
|
// MemoryStore represents in-memory store
|
||||||
type MemoryStore struct {
|
type MemoryStore struct {
|
||||||
store map[interface{}]interface{}
|
store map[interface{}]interface{}
|
||||||
mutex sync.RWMutex
|
mutex sync.RWMutex
|
||||||
|
|
|
@ -4,17 +4,17 @@
|
||||||
|
|
||||||
package xorm
|
package xorm
|
||||||
|
|
||||||
// Executed before an object is initially persisted to the database
|
// BeforeInsertProcessor executed before an object is initially persisted to the database
|
||||||
type BeforeInsertProcessor interface {
|
type BeforeInsertProcessor interface {
|
||||||
BeforeInsert()
|
BeforeInsert()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Executed before an object is updated
|
// BeforeUpdateProcessor executed before an object is updated
|
||||||
type BeforeUpdateProcessor interface {
|
type BeforeUpdateProcessor interface {
|
||||||
BeforeUpdate()
|
BeforeUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Executed before an object is deleted
|
// BeforeDeleteProcessor executed before an object is deleted
|
||||||
type BeforeDeleteProcessor interface {
|
type BeforeDeleteProcessor interface {
|
||||||
BeforeDelete()
|
BeforeDelete()
|
||||||
}
|
}
|
||||||
|
@ -34,17 +34,17 @@ type AfterSetProcessor interface {
|
||||||
//}
|
//}
|
||||||
// --
|
// --
|
||||||
|
|
||||||
// Executed after an object is persisted to the database
|
// AfterInsertProcessor executed after an object is persisted to the database
|
||||||
type AfterInsertProcessor interface {
|
type AfterInsertProcessor interface {
|
||||||
AfterInsert()
|
AfterInsert()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Executed after an object has been updated
|
// AfterUpdateProcessor executed after an object has been updated
|
||||||
type AfterUpdateProcessor interface {
|
type AfterUpdateProcessor interface {
|
||||||
AfterUpdate()
|
AfterUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Executed after an object has been deleted
|
// AfterDeleteProcessor executed after an object has been deleted
|
||||||
type AfterDeleteProcessor interface {
|
type AfterDeleteProcessor interface {
|
||||||
AfterDelete()
|
AfterDelete()
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,7 +371,7 @@ func (session *Session) DB() *core.DB {
|
||||||
return session.db
|
return session.db
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cond return session's conditions
|
// Conds returns session query conditions
|
||||||
func (session *Session) Conds() builder.Cond {
|
func (session *Session) Conds() builder.Cond {
|
||||||
return session.Statement.cond
|
return session.Statement.cond
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,7 @@ func (statement *Statement) Alias(alias string) *Statement {
|
||||||
return statement
|
return statement
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sql add the raw sql statement
|
// SQL adds raw sql statement
|
||||||
func (statement *Statement) SQL(query interface{}, args ...interface{}) *Statement {
|
func (statement *Statement) SQL(query interface{}, args ...interface{}) *Statement {
|
||||||
switch query.(type) {
|
switch query.(type) {
|
||||||
case (*builder.Builder):
|
case (*builder.Builder):
|
||||||
|
@ -795,14 +795,14 @@ func (statement *Statement) col2NewColsWithQuote(columns ...string) []string {
|
||||||
return newColumns
|
return newColumns
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate "Distince col1, col2 " statment
|
// Distinct generates "DISTINCT col1, col2 " statement
|
||||||
func (statement *Statement) Distinct(columns ...string) *Statement {
|
func (statement *Statement) Distinct(columns ...string) *Statement {
|
||||||
statement.IsDistinct = true
|
statement.IsDistinct = true
|
||||||
statement.Cols(columns...)
|
statement.Cols(columns...)
|
||||||
return statement
|
return statement
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate "SELECT ... FOR UPDATE" statment
|
// ForUpdate generates "SELECT ... FOR UPDATE" statement
|
||||||
func (statement *Statement) ForUpdate() *Statement {
|
func (statement *Statement) ForUpdate() *Statement {
|
||||||
statement.IsForUpdate = true
|
statement.IsForUpdate = true
|
||||||
return statement
|
return statement
|
||||||
|
|
Loading…
Reference in New Issue