Git Product home page Git Product logo

stagediver.fx-database's Introduction

stagediver.fx IEW Database

This project adds the ability to work with databases in your stagediver.fx projects. It is based on the stagediver.fx project.

Introduction

This project introduces additional features to the stagediver.fx platform:

  • Connection service to manage connections to different database systems
  • Build in HyperSQL for rapid development
  • Connection pooling with c3p0
  • Experimental Hibernate support

The project can be deployed as a bundle into your stagediver.fx application.

Please note this is a very simple project. It's initial intention is to learn OSGi, learn how to deploy additional bundles into a stagediver.fx project and to sum up my knowledge about non Spring projects :-)

How to use

The following assumes you have used the stagediver.fx archetype to create your application.

  • Github checkout

  • mvn clean install

  • Add the following to the top level pom.xml of your stagediver.fx application. Please change the version to the one you want to use.

          <dependency>
              <groupId>de.iew.stagediver.fx</groupId>
              <artifactId>database-api</artifactId>
              <version>2.0.0-SNAPSHOT</version>
          </dependency>
          <dependency>
              <groupId>de.iew.stagediver.fx</groupId>
              <artifactId>database-core</artifactId>
              <version>2.0.0-SNAPSHOT</version>
          </dependency>
          <dependency>
              <groupId>de.iew.stagediver.fx</groupId>
              <artifactId>database-hibernate</artifactId>
              <version>2.0.0-SNAPSHOT</version>
          </dependency>
    
  • Add the following to the dependencies section of the modules which want to use the database module. It adds the database-api module as a compile time dependency for development. The dependency is not shipped with your module.

          <dependency>
              <groupId>de.iew.stagediver.fx</groupId>
              <artifactId>database-api</artifactId>
          </dependency>
    
  • In your maven-bundle-plugin configuration of the modules add the import de.iew.stagediver.fx.database.* to the Import-Package configuration. It should look similar to:

          <Import-Package>
              ... Many other includes and excludes of the module,
              de.iew.stagediver.fx.database.*
          </Import-Package>
    
  • Add the following to your stagediver.fx main application module. Normally this module should have the -application suffix.

          <dependency>
              <groupId>de.iew.stagediver.fx</groupId>
              <artifactId>database-full</artifactId>
              <version>2.0.0-SNAPSHOT</version>
              <type>pom</type>
              <scope>provided</scope>
          </dependency>
    

Hibernate Support

Please note: the hibernate support is very experimental. I have only tested the basic features of hibernate. Extended second level cache (such as Ehcache) is currently not supported.

To use hibernate in your application you must add the following dependency to your module.

        <dependency>
            <groupId>de.iew.stagediver.fx</groupId>
            <artifactId>database-hibernate</artifactId>
        </dependency>

It's important you also add the following two imports to your module. Otherwise the hibernate packages are not found in an OSGi application.

        org.hibernate.proxy;resolution:=optional,
        javassist.util.proxy;resolution:=optional,

Your module must provide a hibernate.cfg.xml file in the root package or in a maven project just put it into the resources folder of your application.

License

This project is licensed under the terms of the Apache 2.0 license.

stagediver.fx-database's People

Contributors

ventilb avatar

Stargazers

Christian Fritz avatar

Watchers

James Cloos avatar Christian Fritz avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.