func AddRangeCriteria(conditions []*db.Criteria, column *db.Column, leftBound interface{}, rightBound interface{}) ([]*db.Criteria, bool) { if !IsNil(leftBound) || !IsNil(rightBound) { conditions = append(conditions, column.Range(leftBound, rightBound)) return conditions, true } return conditions, false }
func AddWildNoCaseCriteria(conditions []*db.Criteria, column *db.Column, value *string) ([]*db.Criteria, bool) { if !IsEmpty(value) { conditions = append(conditions, column.ILike("%"+*value+"%")) return conditions, true } return conditions, false }
func AddEqualCriteria(conditions []*db.Criteria, column *db.Column, value interface{}) ([]*db.Criteria, bool) { if !IsNil(value) { conditions = append(conditions, column.Matches(value)) return conditions, true } return conditions, false }
func AddNoCaseCriteria(conditions []*db.Criteria, column *db.Column, value *string) ([]*db.Criteria, bool) { if !IsEmpty(value) { var criteria *db.Criteria if HasWildcards(value) { criteria = column.ILike(value) } else { criteria = column.IMatches(value) } conditions = append(conditions, criteria) return conditions, true } return conditions, false }
func (this *GenericTranslator) ColumnName(column *db.Column) string { return column.GetName() }
func (this *FirebirdSQLTranslator) ColumnName(column *db.Column) string { return "\"" + strings.ToUpper(column.GetName()) + "\"" }
func (this *FirebirdSQLTranslator) GetAutoNumberQuery(column *db.Column) string { return "select GEN_ID(" + column.GetTable().GetName() + "_GEN, 1) from RDB$DATABASE" }
func (this *MySQL5Translator) ColumnName(column *db.Column) string { return "`" + strings.ToUpper(column.GetName()) + "`" }
func (this *OracleTranslator) ColumnName(column *db.Column) string { return "\"" + strings.ToUpper(column.GetName()) + "\"" }
func (this *OracleTranslator) GetAutoNumberQuery(column *db.Column) string { return "select " + strings.ToUpper(column.GetTable().GetName()) + "_SEQ.nextval from dual" }
func (this *PostgreSQLTranslator) ColumnName(column *db.Column) string { return strings.ToLower(column.GetName()) }