DBTools ORM Class Generator

DBTools ORM Class Generator.

License

License

GroupId

GroupId

org.dbtools
ArtifactId

ArtifactId

dbtools-gen
Last Version

Last Version

11.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

DBTools ORM Class Generator
DBTools ORM Class Generator.
Project URL

Project URL

https://github.com/jeffdcamp/dbtools-gen
Source Code Management

Source Code Management

https://github.com/jeffdcamp/dbtools-gen

Download dbtools-gen

How to add to project

<!-- https://jarcasting.com/artifacts/org.dbtools/dbtools-gen/ -->
<dependency>
    <groupId>org.dbtools</groupId>
    <artifactId>dbtools-gen</artifactId>
    <version>11.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.dbtools/dbtools-gen/
implementation 'org.dbtools:dbtools-gen:11.0.0'
// https://jarcasting.com/artifacts/org.dbtools/dbtools-gen/
implementation ("org.dbtools:dbtools-gen:11.0.0")
'org.dbtools:dbtools-gen:jar:11.0.0'
<dependency org="org.dbtools" name="dbtools-gen" rev="11.0.0">
  <artifact name="dbtools-gen" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.dbtools', module='dbtools-gen', version='11.0.0')
)
libraryDependencies += "org.dbtools" % "dbtools-gen" % "11.0.0"
[org.dbtools/dbtools-gen "11.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.simpleframework : simple-xml jar 2.7.1
org.jetbrains.kotlin : kotlin-stdlib-jdk7 jar 1.3.0

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-core jar 2.23.0

Project Modules

There are no modules declared in this project.

NOTE: Because of the GREAT addition of Android Room (https://developer.android.com/topic/libraries/architecture/room), I'm deprecating this project. I have also created a conversion from DBTools to Room by using the dbtools-gen type: ANDROID-KOTLIN-ROOM (this will generate Room Entities and Daos from the DBTools schema.xml file). Also, there is a new dbtools-room project that is an library that makes it even easier to work with Google Room Library and SQLite Databases. (https://github.com/jeffdcamp/dbtools-room)

DBTools Generator

DBTools Gen is a ORM Java class file generator and SQL Schema file generator library. DBTools Gen makes it easy to create databases schema files and create JPA ORM Mapping or Android ORM Mapping files.

For platform specific DBTools usage see

Maven Central

Usage

buildscript {
    repositories {
        mavenCentral();
        // or
        jcenter();
    }
    
    dependencies {
        classpath 'org.dbtools:gradle-dbtools-plugin:<VERSION>'
    }
}

// ...
apply plugin: 'dbtools'

// ...
dbtools {
    type 'ANDROID-JAVA' // see options below 

    basePackageName 'com.domain.package.database'
    outputSrcDir 'src/main/java/com/domain/package/database'
}

After setting up gradle you can call the following methods

Method Description
dbtools-init Uses the schemaDir specified above to create a blank database schema file and xml xsd for auto-completion
dbtools-genclasses Uses the options specified above to generate the actual ORM objects in the outputSrcDir

Plugin Options

Key Values Description
type 'ANDROID-JAVA', 'ANDROID-KOTLIN', 'JPA', 'ANDROID-KOTLIN-ROOM' The type of DAO and ORM files to generate. Defaults to 'JPA'
schemaDir e.x. 'src/main/database' The directory the database schema file resides (or will be created with dbtools-init). Defaults to 'src/main/database'
schemaXMLFilename e.x. 'schema.xml' The name of the database schema file. Defaults to 'schema.xml'
basePackageDir e.x. 'com.dbtools.demo.database' The root package the generated DAO and ORM files have
outputSrcDir e.x. 'src/main/java/com/dbtools/demo/database' The directory associated with the basePackageDir
dateType 'JAVA-DATE', 'JODA', 'JSR-310' Specifies the format the Date fields should have. Defaults to 'JAVA-DATE'
injectionSupport true or false Adds annotated Injection (@Inject) to the generated files. Defaults to false
jsr305Support true or false Adds annotated nullable (@Nullable) and nonnull (@NonNull) fields to the generated files. Defaults to false
sqlQueryBuilderSupport true or false Use DBTools-Query for generated queries and views. Defaults to false
includeDatabaseNameInPackage true or false Include the database name in the generated package and directories. Defaults to true
rxJavaSupport true or false Adds RxJava integration support. Defaults to false
javaEESupport true or false Adds JEE/Spring Transactional annotations to CRUD methods in BaseManager. Defaults to false

License

Copyright 2015 Jeff Campbell

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
11.0.0
10.7.0
10.6.0
10.5.0
10.4.0
10.3.1
10.3.0
10.2.0
10.1.4
10.1.3
10.1.2
10.1.1
10.1.0
10.0.2
10.0.1
10.0.0
9.0.0
8.2.1
8.2.0
8.1.1
8.1.0
8.0.0
7.2.2
7.2.1
7.2.0
7.1.1
7.1.0
7.0.11
7.0.10
7.0.9
7.0.8
7.0.7
7.0.6
7.0.5
7.0.4
7.0.3
7.0.2
7.0.1
7.0.0
6.0.1
6.0.0
5.0.3
5.0.2
5.0.1
5.0.0
4.0.2
4.0.1
3.5.1
3.5.0
3.4.1
3.4.0
3.3.1
3.3.0
3.2.0
3.1.4
3.1.3
3.1.2
3.1.1
3.1.0
3.0.0
2.5.0
2.3.0
2.2.1
2.1.0
2.0.0
1.4.12
1.4.11
1.4.10
1.4.9
1.4.2
1.4.1
1.4.0
1.1.0
1.0.0