Daobab rules

It's good to know

There are a few rules, created to establish some order and make query building easy:


1. Implement TablesDictionary in a class where you want to build a query.
This interface provides all tables with tab prefix along with parsers.
Also provides a database documentation available anywhere you need.

Implementing this library is not mandatory, but helps.


2. Prefixes are important
You may find prefixes as follows:
- tab - for tables
- view - for views
- col - for columns
- to - for parse methods
- select - for methods providing queries
- where - for fingle where conditions
- find - for methods provides end results
- join - for joins
- order - for methods providing an order
- having - for simple having conditions


3. Clone objects before modification
At the moment, Daobab objects are mutable.
Because of that, if you want to change them, first clone them to avoid concurrent modifications.
Each entity provides deep clone method.


4. Entities are column instances.
Because of the entity architecture, there is no need to retrieve a column value every time, like this:

whereEqual(tabCar.colOwnerId(), owner.getOwnerId())

It's possible to use:

whereEqual(tabCar.colOwnerId(), owner)


5. Use Whisperers
For some purposes, implementing a Whisperers, may help.
For example if you are using SQLFunctions




© Copyright 2018-2023 Elephant Software Klaudiusz Wojtkowiak 
e-mail: contact@daobab.io