Git Product home page Git Product logo

datanucleus-jpa-query's Introduction

datanucleus-jpa-query's People

Contributors

andyjefferson avatar renataogarcia avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

datanucleus-jpa-query's Issues

@Basic @Lob ArrayList<byte[]> entity field results in errornous metamodel

A field

@Basic
@Lob
private ArrayList<byte[]> imageData = new ArrayList<>();

results in generation of

public static volatile ListAttribute<MyEntity, byte> imageData;

which isn't valid Java and treats a byte[] as byte which is simply wrong using

    <plugin>
        <groupId>org.bsc.maven</groupId>
        <artifactId>maven-processor-plugin</artifactId>
        <version>3.3.2</version>
        <executions>
            <execution>
              <id>datanucleus-metamodel</id>
              <goals>
                    <goal>process</goal>
              </goals>
              <phase>generate-sources</phase>
              <configuration>
                <processors>
                    <processor>org.datanucleus.jpa.query.JPACriteriaProcessor</processor>
                </processors>
              </configuration>
            </execution>
        </executions>
        <dependencies>
            <dependency>        
                <groupId>org.datanucleus</groupId>
                <artifactId>datanucleus-jpa-query</artifactId>
                <version>5.0.3</version>
            </dependency>
        </dependencies>
    </plugin>

A SSCCE is https://gitlab.com/krichter/datanucleus-metamodel-bite-array-field.

experienced with 5.0.3 and 5.0.4-SNAPSHOT and DataNucleus 5.1.4

public final static fields leak into the meta-model

I believe any static field in the entities should be ignored, but the compiler does include them into the metamodel. I only discovered it because I have type parameters, and the compilation choked on them, as they are copied from the source class, without being resolved.

I've posted the test case at [email protected]:veselov/test-jpa.git
Running mvn test fails.

Workaround is to mark the field as @Transient

@Basic @Lob Serializable entity field results in errornous metamodel

A field

@Basic
@Lob
private AbstractUnit<?> priceUnit = (AbstractUnit<?>)AbstractUnit.ONE;

results in generation of

public static volatile SingularAttribute<MyEntity, tec.uom.se.AbstractUnit<Q>> priceUnit;

which uses an unspecified generic parameter Q and thus causes invalid Java code using

    <plugin>
        <groupId>org.bsc.maven</groupId>
        <artifactId>maven-processor-plugin</artifactId>
        <version>3.3.2</version>
        <executions>
            <execution>
              <id>datanucleus-metamodel</id>
              <goals>
                    <goal>process</goal>
              </goals>
              <phase>generate-sources</phase>
              <configuration>
                <processors>
                    <processor>org.datanucleus.jpa.query.JPACriteriaProcessor</processor>
                </processors>
              </configuration>
            </execution>
        </executions>
        <dependencies>
            <dependency>        
                <groupId>org.datanucleus</groupId>
                <artifactId>datanucleus-jpa-query</artifactId>
                <version>5.0.4-SNAPSHOT</version>
            </dependency>
        </dependencies>
    </plugin>

A SSCCE is https://gitlab.com/krichter/datanucleus-metamodel-abstrakt-unit-field.

experienced with 5.0.3 and 5.0.4-SNAPSHOT and DataNucleus 5.1.4 including the fix of #4

The similarity of #4 and this issue point to missing unit test cases or low test coverage. I'll try to get a build script running for a CI service like Travis or GitLab CI which integrates with a coverage measure platform and suggest a PR. In case that fails, you should consider it.

Annotations on field are sometimes not stripped by type handling

If we have a field like

@NotNull 
@Size(max=32) 
String myField

this can sometimes come through the type.toString() as

@javax.validation.constraints.NotNull,@javax.validation.constraints.Size(max=32) java.lang.String

No idea why, because javax.persistence annotations are stripped off.

Seen when using Java9+

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.