Getting Started
// Base ORM Service
c = newCriteria( 'entityName' );
// Virtual
c = newCriteria();
// Examples
var results = c.like("firstName","Lui%")
.maxResults( 50 )
.order("balance","desc")
.and(
c.restrictions.between( "balance", 200, 300),
c.restrictions.eq("department", "development")
)
.list();
// with pagination
var results = c.like("firstName","Lui%")
.order("balance","desc")
.and(
c.restrictions.between( "balance", 200, 300),
c.restrictions.eq("department", "development")
)
.list(max=50,offset=20);
// more complex
var results = c.in("name","luis,fred,joe")
.OR( c.restrictions.isNull("age"), c.restrictions.eq("age",20) )
.list();Last updated
Was this helpful?