Giter Club home page Giter Club logo

batoojpa's Introduction

Build Status Welcome to Batoo JPA - http://batoo.org


Batoo JPA 2.0 Spec Implementation

Deprecated - This project is not maintained anymore!!!

LICENSE

Copyright (c) 2012-2013, Batu Alp Ceylan

This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions of the GNU Lesser General Public License, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this distribution; if not, write to: Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA

FEATURES

  • Full implementation of JPA 2.0 Spec (except for the L2 Cache for now)
  • Minimum deviation from the specification
  • Full JTA Support
  • Built in connection pool for Java SE
  • Prepared Statement cache support for Java SE

COMPATIBILITY

Batoo JPA has been tested with the following databases:

  • Derby
  • HypersonicDB
  • H2
  • MySql
  • PostgreSQL
  • MsSQL
  • Oracle
  • Sybase SQLAnyWhere

Batoo JPA has been tested with the following platforms:

  • Java SE 1.6
  • Java SE 1.7
  • JBoss AS 6.1.0.Final
  • JBoss AS 7.1.1.Final
  • GlassFish 3.1.2.1
  • Apache TomEE 5.0
  • Apache Tomcat 7.0.x

BUILDING

  1. Install Maven 3.0.X if you haven't installed it previously.

  2. Install JDK 1.7 if you haven't installed it previously.

  3. check the project using

    $ git clone git://github.com/BatooOrg/BatooJPA.git

    $ cd BatooJPA

    $ mvn install

Note: The initial build may take a long time.

BENCHMARK

You can use BatooJPABenchmark for benchmarking.

batoojpa's People

Contributors

alesj avatar ammachado avatar asimarslan avatar barreiro avatar bobbywalters avatar hceylan avatar kozzi11 avatar lburgazzoli avatar lukaseder avatar mdpinar avatar tolgagokmen avatar ylemoigne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

batoojpa's Issues

Compiler crash when building with JDK 1.6.0_35

Looks similar to an issue in Guava: http://code.google.com/p/guava-libraries/issues/detail?id=950

[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ batoo-jpa ---
[INFO] Compiling 197 source files to D:\BatooOrg-BatooJPA-4373cf3\batoo-jpa\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error:
An exception has occurred in the compiler (1.6.0_35). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.NullPointerException
        at com.sun.tools.javac.comp.Check.checkCompatibleConcretes(Check.java:1213)
        at com.sun.tools.javac.comp.Check.checkCompatibleSupertypes(Check.java:1565)
        at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2674)
        at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2628)
        at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2584)
        at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2584)
        at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2564)
        at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1045)
        at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:768)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:730)
        at com.sun.tools.javac.main.Main.compile(Main.java:353)
        at com.sun.tools.javac.main.Main.compile(Main.java:279)
        at com.sun.tools.javac.main.Main.compile(Main.java:270)
        at com.sun.tools.javac.Main.compile(Main.java:87)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess0(JavacCompiler.java:551)
        at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:526)
        at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:167)
        at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:678)
        at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

[INFO] 1 error

ManagedList is not serializable

ManagedList is not serializable and therefore serialization fails if you store entities in ViewScoped/SessionScoped beans.

IdClass does not work as expected

Hi,

using @IdClass in one of our entiy beans produces the exception "org.acme.test.BeanPK does not have a corresponding embeddable type."
The id-class BeanPK is not annotated with any annotations.

class BeankPK {
String name;
String key;
...
}

@entity
@IdClass(BeanPk.class)
class Bean {
@id name;
@id key;
...
}

The same code is working fine in hibernate and should work accoring to JPA-spec 11.1.19 and 2.4

Downgrade asm to 3.3.1

ASM 4.0 is fairly new and conflicts with a number of frameworks.

Downgrading to 3.3.1 is the solution.

Implement Pluggable Datasource Inlets

A Plugabble datasource implementation that will:

  • Take a class name to be instantiated by means of reflection with constructor of Map<String, String> param
  • That will pass settings in means of java beans reflection

i.e.:

batoo.datasource.com.jolbox.bonecp.class= com.jolbox.bonecp.BoneCPDatasourceProxy
batoo.datasource.com.jolbox.bonecp.statementsCacheSize= 50
batoo.datasource.com.jolbox.bonecp.releaseHelperThreads= 0
(...)

Use BoneCP as the datasource manager

Would it be possible to allow pluggable ConnectionPools in the future?
As we use BoneCP in all projects (and we are very happy with it!), this would be a great feature.

Constant expression is not handled properly

Test Case created.

public class SimpleCriteriaTest extends BaseCoreTest {

    (..)

    /**
     * 
     * @since $version
     * @author hceylan
     */
    @Test
    public void testSimple3() {
        final Person person = this.person();

        this.persist(person);
        this.persist(this.person());

        this.close();

        final CriteriaBuilderImpl criteriaBuilder = this.em().getCriteriaBuilder();
        final CriteriaQueryImpl<Address> criteriaQuery = criteriaBuilder.createQuery(Address.class);
        final RootImpl<Address> from = criteriaQuery.from(Address.class);
        final List<PredicateImpl> predicates = new ArrayList<PredicateImpl>();
        predicates.add(criteriaBuilder.equal(from.get("person"), person));
        criteriaQuery.select(from);
        if (!predicates.isEmpty()) {
            criteriaQuery.where(criteriaBuilder.and(predicates.toArray(new Predicate[predicates.size()])));
        }
        final TypedQuery<Address> query = this.em().createQuery(criteriaQuery);

        query.getResultList();
    }
}
-----------------------------------------------------------------------------------------------------------------------------------
| SELECT                                                                                                                          |
|     E0_P.id AS E0_P_F0, E0_P.person_id AS E0_P_F1, E0_P.primary_ AS E0_P_F2, E0_P.country_code AS E0_P_F3, E0_P.city AS E0_P_F4 |
| FROM Address E0_P                                                                                                               |
|     LEFT JOIN Person E1_P ON E0_P.person_id = E1_P.id                                                                           |
| WHERE                                                                                                                           |
|     (E1_P.id = 'org.batoo.jpa.core.test.q.Person@e9c51bb')                                                                      |
-----------------------------------------------------------------------------------------------------------------------------------

[perf] Avoid for each loops on ArrayList [2]

I will provide a patch tomorrow.

If you have a idea how to optimize

  • ManagedList line 192

and replace the iterator loop with a index based loop in

  • PluralAssociationMapping line 573

we only have aroud 15k iterator instances anymore.

900k vs 15k should be a great performance boost.

Batoo + Postgre schemas + @Table annotation

When I use @table anotation on an entity class, it was created sucessfull, but when i try to make any query, the generated SQL doesn't contains the schema prefix.

Postgre 9.1
Glassfish 3.2
Batoo 0.1.3

@Id @ManyToOne attribute will be handled as basic attribute

A attribute with @id and @manytoone will be handled as BASIC attribute in 0.1.3:

@Id
@ManyToOne
@NotNull
@JoinColumn(name = "entity2Id", nullable = false)
private Entity2 entity2;

ParentMapping#createMapping reads the attribute#getPersistentAttributeType() and this returns PersistentAttributeType#BASIC for this attribute.

QueryDSL like API

As far as I understand the goal was to have JPA compliant ORM implementation.
I guess since BatooJPA is JPA compliant I can use http://www.querydsl.com/ just on top of BatooJPA. But since this adds another layer of abstraction (and sometimes defects) on top of existing ORM I am wondering if it will add some additional overhead in terms of performance.

Have you considered proving proprietary API for more elegant querying? It would make BatooJPA not only the fastest but the easiest to use as well.

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.