This commit is contained in:
@@ -23,13 +23,13 @@ func NewOrmCache(tables []*Table) *OrmCache {
|
||||
func (o *OrmCache) add(table *Table) {
|
||||
o.mu.Lock()
|
||||
defer o.mu.Unlock()
|
||||
o.data[table.TypeName] = table
|
||||
o.data[table.Type.Name()] = table
|
||||
}
|
||||
|
||||
func (o *OrmCache) Get(tableName string) (*Table, bool) {
|
||||
func (o *OrmCache) Get(typeName string) (*Table, bool) {
|
||||
o.mu.RLock()
|
||||
defer o.mu.RUnlock()
|
||||
table, ok := o.data[tableName]
|
||||
table, ok := o.data[typeName]
|
||||
return table, ok
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user