Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateOrderByExp ¶
func GenerateOrderByExp(source string, dict PropertyDict) string
GenerateOrderByExp returns a generated orderBy expresion by given source dto order string (split by ",", such as "name desc,age asc") and PropertyDict. The generated expression is in mysql-sql and neo4j-cypher style, that is "xx ASC", "xx DESC".
Types ¶
type PropertyDict ¶
type PropertyDict map[string]*PropertyValue
PropertyDict represents a DTO-PO PropertyValue dictionary, used in GenerateOrderByExp.
type PropertyValue ¶
type PropertyValue struct {
// contains filtered or unexported fields
}
PropertyValue represents a PO entity's property mapping rule.
func NewPropertyValue ¶
func NewPropertyValue(reverse bool, destinations ...string) *PropertyValue
NewPropertyValue creates a PropertyValue by given reverse and destinations.
func (*PropertyValue) Destinations ¶
func (p *PropertyValue) Destinations() []string
Destinations returns the destinations of PropertyValue.
func (*PropertyValue) Reverse ¶
func (p *PropertyValue) Reverse() bool
Reverse returns the reverse of PropertyValue.
Click to show internal directories.
Click to hide internal directories.