Giter Club home page Giter Club logo

e4geminijpa's Introduction

Build Status

Goal

Add the ability to inject EntityManagers for a certain persistence unit in Eclipse 4.

@Inject
@GeminiPersistenceContext(unitName="puTest")
EntityManager em;

There are even more configurable modes like

@Inject
@GeminiPersistenceContext(unitName="puTest", properties = {
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.JDBC_DRIVER, value="org.gjt.mm.mysql.Driver"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.JDBC_URL, value="jdbc:mysql://127.0.0.1/test"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.JDBC_USER, value="test"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.JDBC_PASSWORD, value="test"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.DDL_GENERATION, value=PersistenceUnitProperties.DROP_AND_CREATE),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.DDL_GENERATION_MODE, value=PersistenceUnitProperties.DDL_DATABASE_GENERATION),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.CONNECTION_POOL_MIN, value="20"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.TEMPORAL_MUTABLE, value="true"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.WEAVING, value="false"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.WEAVING_INTERNAL, value="false"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.LOGGING_LEVEL, value="FINEST"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.LOGGING_TIMESTAMP, value="true"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.LOGGING_SESSION, value="true"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.LOGGING_THREAD, value="true"),
 @GeminiPersistenceProperty(name=PersistenceUnitProperties.LOGGING_EXCEPTIONS, value="true")
})
private EntityManager entityManager;

Sample Application

The sample application contains three sample database which can be connected to:

  • Apache Derby
  • Apache HSQL
  • MySQL

If you want only one to start you have to change the org.e4.gemini.rcp plugin.xml and remove the required plugins. For each database you have to install, or add to target platform, certain Gemini Bundles.

Apache Derby

Apache Derby is a database written in java. It supports an embedded mode, so you can start it within the application.

Download Gemini DBAccess and add this to your target platform.

Apache HSQL

HSQL is a database written in Java. It supports an embedded mode, so you can start it within the application.

To run HSQL you have to checkout this repository on the hsql branch and import the dbaccess and hsql library bundle.

MySQL

MySQL is a well-known database. You have to start your own server to connect with the sample application. The predefined credentials are:

  1. Host: 127.0.0.1
  2. Database: test
  3. User: test
  4. Password: test

Make sure the test user has full priveliges in order to execute drop-and-create-database correctly.

To use the MySQL Connector you have to clone this repository Currently you have to change a bit of code according to this bug report

Work done by

This repository contains the work done by Filipp A. and Nepomuk Seiler. See Gemini Forum Post for more information.

e4geminijpa's People

Contributors

muuki88 avatar atlasloewenherz avatar davidbecker avatar

Watchers

James Cloos 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.