use of com.bluenimble.platform.db.impls.DefaultDatabaseObjectSerializer 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.impls.DefaultDatabaseObjectSerializer 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.impls.DefaultDatabaseObjectSerializer 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)));
}
use of com.bluenimble.platform.db.impls.DefaultDatabaseObjectSerializer in project serverless by bluenimble.
the class Load method main.
public static void main(String[] args) throws Exception {
Database db = new DatabaseServer().get();
DatabaseObject spa = db.create("SpaStreams");
spa.load(Json.load(new File("tests/data-1.json")));
spa.save();
System.out.println(spa.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
use of com.bluenimble.platform.db.impls.DefaultDatabaseObjectSerializer in project serverless by bluenimble.
the class UpdateOne2One method main.
public static void main(String[] args) throws DatabaseException {
Database db = new DatabaseServer().get();
DatabaseObject driver = db.get("Drivers", "722388b0-9a9a-459e-a583-d802653a60b0");
driver.set("address", "Never Found");
DatabaseObject car = (DatabaseObject) driver.get("car");
car.set("model", "AlphaRomeo");
driver.save();
System.out.println();
System.out.println("+===============================================================================+");
System.out.println();
System.out.println(driver.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
Aggregations