bug fixed for SuffixMapper

This commit is contained in:
Lunny Xiao 2014-05-11 13:24:41 +08:00
parent 7b00cece84
commit 269c3fffe1
1 changed files with 2 additions and 2 deletions

View File

@ -164,11 +164,11 @@ type SuffixMapper struct {
}
func (mapper SuffixMapper) Obj2Table(name string) string {
return mapper.Suffix + mapper.Mapper.Obj2Table(name)
return mapper.Mapper.Obj2Table(name) + mapper.Suffix
}
func (mapper SuffixMapper) Table2Obj(name string) string {
return mapper.Mapper.Table2Obj(name[len(mapper.Suffix):])
return mapper.Mapper.Table2Obj(name[:len(name)-len(mapper.Suffix)])
}
func NewSuffixMapper(mapper IMapper, suffix string) SuffixMapper {