Skip to content

Generates SQL scripts, Java/.NET Entity files and transfers sample data from and to Access databases.

License

Notifications You must be signed in to change notification settings

pro-vision/pv-entitygenerator

Repository files navigation

PVEntityGenerator

Generates SQL scripts, Java/.NET Entity files and transfers sample data from and to Access databases.

Overview

PVEntityGenerator is a tool for database applications written in Java and .NET. It's primary target to be used together with the "PVFramework", a proprietary RDBMS mapping framework for legacy Java and .NET applications. But it can also be used standalone as handy tool to transfer table structures and data between an MS Access database and RDMBS servers.

The main functionality:

  • Create or update database structures (via auto-generated SQL scripts) in the RDMBS server as defined in the Access database
  • Transfer data from the Access database to the RDMBS server and vice versa
  • Generate Java/.NET "Entity" class files to be used with the "PVFramework" library

Database support

The tool was tested with (but supports newer versions as well):

Platform Versions
SQLServer Microsoft SQL Server 2000-2005
Oracle Oracle 8i-10g
MySQL MySQL 4.x-5.x
PostgreSQL (experimental)

Supported Access database formats:

  • Access 2000 (.mdb)
  • Access 2007 and up (.accdb)

Code Generation support

Platform Versions
Java2 Java2 (JDK 1.4) with PVFramework für Java 3.x
Java5 Java5 (JDK 1.5) with PVFramework für Java 4.x
Java5JPA Java5 (JDK 1.5) with Java Persistence (JPA) and Hibernate
NET Microsoft .NET Framework 1.1 mit PVFramework.NET 2.x
NET20 Microsoft .NET Framework 2.0 mit PVFramework.NET 3.x

Database Model Definition

The database as models in the Access database is the base for the DDL statements generated by the PVEntity Generator including:

  • Tables
  • Columns
  • Data Types
  • Default Values
  • Primary Keys
  • Foreign Keys
  • Indexes

However, some features available in RDMBS servers are not available in Access. It's possible to set special "attributes" in the description of each column in the Access database to further customize the data model generated for the RDBMS. These attributes follow the syntax #attribute without a value and #attribute=value for attributes with value. It's possible to add multiple attributes additional to a description comment for a single field. Example:

Field Desciption #size=300 #notest

Supported attributes for all platforms:

Attribute Description Example
size Defines to size of a VARCHAR or CLOB column (independently of the size defined in the Access database which is limited to 255). If this attribute is set on a CLOB columns is generated as VARCHAR on the RDMBS server. #size=300
identity Enables "Auto-Increment"/"Identity" for the column, that means the RDBMS fills it with a new incremented value for each new row. May be not supported for all RDBMS servers. #identity
auto-increment Same as 'identity' #auto-increment
notest If set not unit tests are generated automatically for the entity classes #notest
deprecated The column is marked as deprecated in the generated entity class. #deprecated

Additional attributes currently only supported for the 'Java5JPA' platform:

Attribute Description Example
xmlmapping Defines a class name for mapping XML content in a CLOB column. The class has to be a POJO with serializable fields. #xmlmapping=xxx.yyy.MappingClass
searchindex Defines that this column is index by full text search. Optionally the index type can be specified as value:
analyzed (previously: tokenized, default)
not_analyzed (previously: un_tokenized)
not_analyzed_no_norms (previously: no_norms)
analyzed_no_norms
no
#searchindex=analyzed
searchstore Defines if the column value itself should be stored in the index document: no (default), yes, compress #searchstore=yes
searchembeddepth Defines for foreign key columns if depending objects should be indexed as well ("IndexEmbedded"). The value defines the depth. #searchembeddepth=1
searchboost Defines a search boost factor (float number) #searchboost=2.5
searchdateresolution Defines the resolution for timestamp fields: year, month, day (default), hour, minute, second, millisecond #searchdateresolution=day
searchfieldbridge Defines the class name of a custom "FieldBridge" or "StringBridge" implementation. #searchfieldbridge=xx.yy.FieldBridgeImpl

Developing PVEntityGenerator

Recommended environment for developing PVEntityGenerator:

About

Generates SQL scripts, Java/.NET Entity files and transfers sample data from and to Access databases.

Resources

License

Stars

Watchers

Forks

Packages

No packages published