use of com.bluenimble.platform.db.DatabaseObject in project serverless by bluenimble.
the class FindAllWithSelect method main.
public static void main(String[] args) throws Exception {
String query = "{ select: [name], orderBy: { name: asc } }";
Database db = new DatabaseServer().get();
List<DatabaseObject> employees = db.find("Employees", new JsonQuery(new JsonObject(query)), null);
for (DatabaseObject employee : employees) {
System.out.println(employee.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
}
use of com.bluenimble.platform.db.DatabaseObject in project serverless by bluenimble.
the class FindAllWithSort method main.
public static void main(String[] args) throws Exception {
String query = "{ orderBy: { name: asc } }";
Database db = new DatabaseServer().get();
List<DatabaseObject> employees = db.find("Employees", new JsonQuery(new JsonObject(query)), null);
for (DatabaseObject employee : employees) {
System.out.println(employee.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
}
Aggregations