Get Your Results





The fastest data retrieval

DBDatabase Gets Results

Retrieving rows is the easiest part of working with databases in DBvolution

The database connection is managed automatically, the fields are set, and even accidental blank queries and cartesian joins are prevented

DBDatabase provides the simplest mechanism: just set an example object and use get():

CarCompany carCo = new CarCompany();
carCo.name.permittedValues("TOYOTA");
List<CarCompany> toyotaCarCo = database.get(carCo);

If you try this with several DBRow instances a slightly different result is returned:

List<DBQueryRow> allRows = database.get(carCo, new Marque());

DBQueryRow is a collection of DBRow instances representing all the objects connected to each separate result of the underlying query. To retrieve the individual objects, use the get() method of the DBQueryRow with an exemplar:

for (DBQueryRow row : allRows){
    Marque aMarque = row.get(new Marque());
    CarCompany aCarCo = row.get(carCo);
}

DBvolution is thrifty with objects and avoids creating duplicate objects. If there is more than one Marque associated with the CarCompany, the database will return several copies of the car company's details. However DBvolution detects this situation and creates only one CarCompany object and links to it in each DBQueryRow


When you want DB to be easier and faster...

Get DBvolution from GitHub or Maven

DBvolution is the gateway to your database and high-speed querying
  Contact us now for details
  +64 27 444 5201
  FaceBook
Twitter
Support us on Patreon