Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Metamodel generation issue for @NotNull and @Lob byte[] (The metamodel class is getting generated with invalid Java causing a compilation error)
Metamodel generation issue for @NotNull and @Lob byte[] [message #1800550] Wed, 02 January 2019 09:04
Rainer Schamm is currently offline Rainer SchammFriend
Messages: 1
Registered: January 2019
Junior Member
Hi all

I have an entity with this field:

...
   @Basic(optional = false)
   @NotNull
   @Lob
   @Column(name = "bytes")
   private byte[] bytes;
...


That is generating this broken metamodel class:

...
package com.pimetix.smemetrics.ejb.entity;

import (@javax.validation.constraints.NotNull :: byte);
import com.pimetix.smemetrics.ejb.entity.OrganisationMail;
import javax.annotation.Generated;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;

@Generated(value="EclipseLink-2.7.3.v20180807-rNA", date="2019-01-02T10:45:28")
@StaticMetamodel(OrganisationMailAttachment.class)
public class OrganisationMailAttachment_ { 

    public static volatile SingularAttribute<OrganisationMailAttachment, OrganisationMail> organisationMailId;
    public static volatile SingularAttribute<OrganisationMailAttachment, NotNull :: byte)[]> bytes;
    public static volatile SingularAttribute<OrganisationMailAttachment, String> name;
    public static volatile SingularAttribute<OrganisationMailAttachment, Integer> id;
    public static volatile SingularAttribute<OrganisationMailAttachment, String> contentType;

}
...

Specifically look at this:

public static volatile SingularAttribute<OrganisationMailAttachment, NotNull :: byte)[]> bytes;


or this:

import (@javax.validation.constraints.NotNull :: byte);



If I remove the @NotNull annotation then everything is getting generated just fine.

...
   @Basic(optional = false)
   @Lob
   @Column(name = "bytes")
   private byte[] bytes;
...

...
package com.pimetix.smemetrics.ejb.entity;

import com.pimetix.smemetrics.ejb.entity.OrganisationMail;
import javax.annotation.Generated;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;

@Generated(value="EclipseLink-2.7.3.v20180807-rNA", date="2019-01-02T10:54:24")
@StaticMetamodel(OrganisationMailAttachment.class)
public class OrganisationMailAttachment_ { 

    public static volatile SingularAttribute<OrganisationMailAttachment, OrganisationMail> organisationMailId;
    public static volatile SingularAttribute<OrganisationMailAttachment, byte[]> bytes;
    public static volatile SingularAttribute<OrganisationMailAttachment, String> name;
    public static volatile SingularAttribute<OrganisationMailAttachment, Integer> id;
    public static volatile SingularAttribute<OrganisationMailAttachment, String> contentType;

}
...


Does anyone have an idea whats is going wrong?

This using the latest Payara 5.184 distro, that ships with: EclipseLink-2.7.3.v20180807-rNA

Thanks in advance!
Rainer



Regards
Rainer


...




Previous Topic:createNativeQuery : Exception [EclipseLink-4002]
Next Topic:Migrate RCP to Java11 using MOXy
Goto Forum:
  


Current Time: Wed Aug 21 04:28:42 GMT 2019

Powered by FUDForum. Page generated in 0.01441 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top