From 269c3fffe1541072cc52d361693d7990537677ae Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 11 May 2014 13:24:41 +0800 Subject: [PATCH] bug fixed for SuffixMapper --- mapper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mapper.go b/mapper.go index fb209a7c..8fc115f1 100644 --- a/mapper.go +++ b/mapper.go @@ -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 {