use of com.bluenimble.platform.db.DatabaseObject in project serverless by bluenimble.
the class FindOne2One method main.
public static void main(String[] args) throws Exception {
String query = "{ }";
Database db = new DatabaseServer().get();
List<DatabaseObject> drivers = db.find("Drivers", new JsonQuery(new JsonObject(query)), null);
for (DatabaseObject driver : drivers) {
System.out.println(driver.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
}
use of com.bluenimble.platform.db.DatabaseObject 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", "5aa4192e5e6726413c7db45a");
System.out.println(employee.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
use of com.bluenimble.platform.db.DatabaseObject in project serverless by bluenimble.
the class GetOne2One method main.
public static void main(String[] args) throws DatabaseException {
Database db = new DatabaseServer().get();
DatabaseObject driver = db.get("Drivers", "5aa425145e67264b7858685a");
DatabaseObject car = (DatabaseObject) driver.get("car");
System.out.println(car.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
use of com.bluenimble.platform.db.DatabaseObject in project serverless by bluenimble.
the class GetWithId method main.
public static void main(String[] args) throws DatabaseException {
Database db = new DatabaseServer().get();
DatabaseObject dbo = db.get("WithIds", 100);
System.out.println("Object Id: " + dbo.getId());
System.out.println(dbo.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
use of com.bluenimble.platform.db.DatabaseObject in project serverless by bluenimble.
the class UpdateOne2One method main.
public static void main(String[] args) throws DatabaseException {
Database db = new DatabaseServer().get();
DatabaseObject employee = db.get("Employees", "5aa4192e5e6726413c7db45a");
employee.set("address", "Never Found");
DatabaseObject city = (DatabaseObject) employee.get("city");
city.set("name", "Eldorado");
employee.save();
System.out.println(employee.toString());
System.out.println();
System.out.println("+===============================================================================+");
System.out.println();
System.out.println(employee.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
Aggregations