Database DAO Tool
Overview
The nitrohammer DAO tool will allow you to easily setup,maintain and access your applications database. The following features are available with this tool.
  1. Database Specificiation
  2. Auto Generation of SQL commands to create the database
  3. Auto Generation of Pojo Beans source code
  4. Auto Generation of Unit Test of Pojo Beans, as source code
  5. Auto Generation of Database Access layer, as source code
  6. Auto Generation of Unit Test of Database Access layer, as source code
  7. Auto Generation of Rest Service, as source code
  8. Auto Generation of Unit Test of Rest Service, as source code
  9. Generate random data for database simulations
  10. Interoperability, with databases which use JDBC interface, Oracle, MSSql, MySql, H2, etc
  11. Interoperability, with Mongo database
  12. Interoperability, with HBase database
  13. Interoperability, with JPA database
References
Simple example
The following shows many of the basic features of this DAO tool. The following is an XML which specifies a table in a database and it's corresponding columns. The following XML sepcifies a table in a database, under schema "test", and tablename "User". It has several columns, one of which is 'username' of java type String and of max length of 32 characters. The 'username' column always requires data, NULL is not allowed. The 'username' is a primary key, but is assigned by the client, that is, the 'username' is NOT auto-assigned by the databaase. The logical type of the username, corresponds to email addresses, and can be randomly assigned for simulation purposes from the email.list.
database model (user.xml)
ant generation script
The following portion of an ant script shows how to run the DAO tool (Schematool) to auto-generate a series of Java files. TODO
Auto generate Pojo Bean
Auto generate Unit test Pojo Bean
Auto generate CRUD Level unit tests
Auto generate Rest Service software
Auto generate Rest Service Unit test software
DAO Layer
Memory Adapter
Detailed Specification of database schema

Database Definition

Attributes

All implementations of Database support the following attributes:

AttributeDescription
name

The name of the database (or some cases the database schema). The value of the name is case insensitive.

charset-name

The default charset name to use for this database.

collation-name

The default collation name to use for this database.

package-name

The base name of the Java Package to use for generating Java classes.

Version

The version of this database schema definition (version 1)

Nested Components
ElementDescription
table

A table definition within the parent database name (schema).

procedure

A stored procedure definition within the parent database name (schema).

trigger

A trigger definition within the parent database name (schema).

Detailed Specification of database table

Table Definition

Attributes

All implementations of Table support the following attributes:

AttributeDescription
name

The name of the table. The value of the name is case insensitive. This name will also be the name of the Java classes, combined with the package-name defined in the database element. Java Class names will be leading character upper case, and other operations may be performed on the name for the Java class name or for the database table name.

java-name

Optional, attribute for specifying exactly the Java class name to be used for the beans which will reflect this table

database-name

Optional, attribute for specifying exactly the name of the database table.Not the name of the database.

table-type

The type of table, can be plain table , view , bean , etc.

base-class

The base class of the created beans for this table, gennerally not used.

charset-name

The default charset name to use for this database.

collation-name

The default collation name to use for this database.

data-directory

TODO

description

TODO

delay-key-write

TODO

engine

TODO

generator

TODO

has-checksum

TODO

index-directory

TODO

interface

TODO

is-abstract

TODO

is-default

TODO

is-final

TODO

table-view

TODO

maximum-rows

TODO

minimum-rows

TODO

pack-keys

TODO

password

TODO

raid-type

TODO

raid-chunks

TODO

raid-chunk-size

TODO

row-format

TODO

skip-sql

TODO

union

TODO

iterations

TODO

Nested Components
ElementDescription
column

A column definition within the parent table.

foreign-key

A collection of columns which combined make a key into the database

index

TODO

sql-select

SQL select to be called to support tables of type view .

sql-update

A trigger definition within the parent database name (schema).

sql-insert

A trigger definition within the parent database name (schema).

sql-delete

A trigger definition within the parent database name (schema).

row

Define a collection of rows which are to seed te database.

Detailed Specification of database column

Column Definition

Attributes

All implementations of Column support the following attributes:

AttributeDescription
name

The name of the column. The value of the name is case insensitive. This name will also be the name of the Java property. Names will be altered to suit Java properties vs database column names.

table-name

TODO

database-name

TODO

decimal-size

TODO

default-value

TODO

description

TODO

remarks

TODO

id-method

TODO

java-type

TODO

data-type

TODO

generic-type

TODO

logical-type

TODO

ordinal-position

TODO

size

TODO

natural-key

TODO

primary-key

TODO

persistent

TODO

optional

TODO

required

TODO

secure

TODO

unique

TODO

unsigned

TODO

zero-fill

TODO

binary

TODO

ascii

TODO

unicode

TODO

Nested Components
ElementDescription
enum-value

The list of data for this field, as an enumeration value.

formatter

A format string, or java class which can be called to format the column field for display.

minimum-value

For number values, the minimum allow value for this field.

maximum-value

For number values, the maximum allow value for this field.

options

TODO

validations

The list of java classes which can be called to validate this field, useful on the UI.

Enumeration Values

The following are the enumeration values specified above with definitions.

EngineType
ValueDescription
default

bdb

heap

isam

innodb

merge

mrg_myisam

myisam

memory

blackhole

csv

archive

performance_schema

RaidType
ValueDescription
1

striped

raid0

RowFormatType
ValueDescription
default

dynamic

fixed

compressed

redundant

compact

TableType
ValueDescription
table

local-temporary

bean

view

system-table

system-view

global-temporary

alias

synonym

data

base-table

crud-bean

interface

JavaNamingMethodType
ValueDescription
nochange

underscore

javaname

If you have any questions or suggestions about our web site, please contact: webmaster@vipersoftwareservices.com

Downloads
Version 1.5
Release 02/20/2019
DOWNLOAD BINARYDOWNLOAD SOURCES