Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 2.05 KB

README.md

File metadata and controls

55 lines (42 loc) · 2.05 KB

jpql-executor

Description

The simple CLI-application for executing JPQL (Java Persistence Query Language) queries to databases.

Requirements

It needs a Java Virtual Machine of at least version 1.6 (Java SE 6.0). If you want to build the jar from source, you will also need Maven.

Usage

  1. Build with Maven:

    mvn package
  2. Unpack created archive jpql-executor*.zip.

  3. Place the required JDBC-driver for your database into the lib directory.

  4. Run application with following syntax:

    jpql-executor.bat <entities archive> <unit name> <JPQL query>

    Where:
    entities archive - the jar-file with entity classes (@Entity),
    unit name - the persistence unit name described in the persistence.xml inside jar-file with entity classes,
    JPQL query - the query string

    Example:

    jpql-executor.bat entity.jar default "SELECT entity FROM Entity entity"

Restrictions

The application is execute in unmanaged environment as JavaSE program (without application container).
Therefore possible to use only persistence.xml with explicit database properties (url, user, password) and not with JNDI and other EE technologies.

License

The MetaJ library publish under the Apache Software License, Version 2.0.

Continuous Integration

Last build status on Travis CI:

Build Status