use of com.bluenimble.platform.db.impls.DefaultDatabaseObjectSerializer in project serverless by bluenimble.
the class FindOne method main.
public static void main(String[] args) throws DatabaseException {
Database db = new DatabaseServer().get();
DatabaseObject city = db.findOne("Cities", new JsonQuery(new JsonObject()));
System.out.println(city.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
use of com.bluenimble.platform.db.impls.DefaultDatabaseObjectSerializer in project serverless by bluenimble.
the class Get method main.
public static void main(String[] args) throws DatabaseException {
Database db = new DatabaseServer().get();
DatabaseObject employee = db.get("Employees", "3e6b5afe-166d-46cd-b6a9-66ec0bb581d4");
System.out.println(employee.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
use of com.bluenimble.platform.db.impls.DefaultDatabaseObjectSerializer in project serverless by bluenimble.
the class FindAllWithCount method main.
public static void main(String[] args) throws Exception {
String query = "{ count: 1 }";
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.impls.DefaultDatabaseObjectSerializer 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.impls.DefaultDatabaseObjectSerializer 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