ColMap returns the ColumnMap pointer matching the given struct field name. It panics if the struct does not contain a field matching this name.
(field string)
| 100 | // name. It panics if the struct does not contain a field matching this |
| 101 | // name. |
| 102 | func (t *TableMap) ColMap(field string) *ColumnMap { |
| 103 | col := colMapOrNil(t, field) |
| 104 | if col == nil { |
| 105 | e := fmt.Sprintf("No ColumnMap in table %s type %s with field %s", |
| 106 | t.TableName, t.gotype.Name(), field) |
| 107 | |
| 108 | panic(e) |
| 109 | } |
| 110 | return col |
| 111 | } |
| 112 | |
| 113 | func colMapOrNil(t *TableMap, field string) *ColumnMap { |
| 114 | for _, col := range t.Columns { |