Chapter 1. Introduction

Abstract

This documentation covers the process of generating a first Spring-based Web application project using SpringFuse online service.

1.1. What is SpringFuse?

SpringFuse is an online service to kickstart your Spring-based Web application projects.

SpringFuse generates from a relational database model and some conventions over configuration the entire infrastructure of a Java/J2ee Web application that compiles and runs out-of-the-box. There is no need to learn a new language or some esoteric concepts. The generated code is self-sufficient to run in production.

The generated code leverages know-how and expertise acquired by its authors and the Java developer community. The code generation process is fast and flexible. You keep the control of your database schema and you can change it without the frustration of having to re-code manually some infrastructure code.

The generated project follows Maven 2 conventions. The generated code leverages the best Open Source technologies such as Spring Framework, Spring Security, Spring MVC, Hibernate and many more. There is no cyclic dependency between the generated packages. The generated code is readable. Unit tests and integration tests are also generated. It supports most popular databases, as Hibernate does.

By working with the well documented and organized generated source code, which uses the best Open Source technologies in optimal ways, you are going to educate yourself faster. You can use the time gained to develop real business features, for your final customer satisfaction.

1.2. How does SpringFuse work?

SpringFuse uses your database schema as an entry point. Therefore you must extract your database schema and upload it to SpringFuse in order to generate a project. Here are the main step to generating a project using SpringFuse:

1.2.1. Extract your database schema locally

This step is done using our free schema extractor tool which is distributed as a Maven 2 plugin. It extracts from your database the various meta-data information such as the table names, the column names and types, the constraints and relations, etc. The extracted information is dumped into a file. The file is formatted using Google's protocol buffer.

1.2.2. Upload your database schema and generate your project

Once extracted, you can upload the file produced by the schema extractor tool and adjust online few parameters such as the project and the package names. The generation process starts as soon as you upload your database schema and should take less than 30 seconds to complete.

1.2.3. A word about the generation process and conventions

The database schema is not the only input to generate a project. Some conventions are also taken into account. By using convention you will end up with a cleaner generated source code and some additional helper methods and features.

1.2.4. Download your project

Once your project is generated you can download it and use it as a starting point.

1.3. Prerequisites

1.3.1. Java 1.5 or higher

The generated Java code is compliant with JDK 5 and above. Please download and install JDK 1.5 or above from http://java.sun.com . Once installed, make sure you can run Javac from the command line. Open a command line, run 'javac –version' and make sure the output is similar to this:

C:\Users\Nicolas>javac -version
javac 1.5.0_12
javac: no source files
Usage: javac <options> <source files>
where possible options include:
  -g                         Generate all debugging info
  -g:none                    Generate no debugging info

1.3.2. Maven 2.0.x, with x>9

Maven is a widely adopted build system. It is required by both the database meta-information extracting tool and by the generated project itself. Please download and install Maven 2 from http://maven.apache.org . Once installed, make sure you can invoke Maven 2. From a command line, run mvn -version and make sure you get an output similar to this:

C:\Users\Nicolas>mvn -version
Maven version: 2.0.9
Java version: 1.5.0_12

1.3.3. Database requirements

1.3.3.1. A database connection

Make sure that you can access the target database from your computer. We support in theory any relational database supported by Hibernate.

1.3.3.2. Hibernate Sequence for numerical primary keys

Each numerical primary key is configured in the Hibernate mapping file with '<generator class="native"/>'. If your database does not support identity columns, you should create the sequence 'hibernate_sequence'. Please refer to Hibernate reference documentation for more advanced alternatives.

1.3.4. Other dependencies

The other dependencies are the various Open Source frameworks used by the generated project. Since the generated project uses Maven, these dependencies will be downloaded automatically by Maven the first time you run your project!