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 Go to next message
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


...




Re: Metamodel generation issue for @NotNull and @Lob byte[] [message #1836496 is a reply to message #1800550] Tue, 05 January 2021 23:30 Go to previous messageGo to next message
Pablo Pina is currently offline Pablo PinaFriend
Messages: 3
Registered: January 2021
Junior Member
Same parananormal fenomenom here, was working fine a few days ago
Re: Metamodel generation issue for @NotNull and @Lob byte[] [message #1836562 is a reply to message #1800550] Thu, 07 January 2021 13:25 Go to previous messageGo to next message
Pablo Pina is currently offline Pablo PinaFriend
Messages: 3
Registered: January 2021
Junior Member
Ok, seems to have nothing to do with the EL version, but works fine with

<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
</dependency>

And not with

<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0.1</version>
</dependency>

Same issue regardless of EL 2.6.3 or 2.7.X
Re: Metamodel generation issue for @NotNull and @Lob byte[] [message #1838348 is a reply to message #1836562] Mon, 22 February 2021 17:29 Go to previous message
Aaron Boudreaux is currently offline Aaron BoudreauxFriend
Messages: 1
Registered: February 2021
Junior Member
Were you ever able to resolve your problem using javaee/jakartaee 8.0? I am having the same problem when trying to upgrade to payara 5 which uses jakarta ee 8 now.
Previous Topic:ClassNotFoundException on EclipseLink MOXy
Next Topic: [bug] MOXy @XmlNullPolicy not working with enums
Goto Forum:
  


Current Time: Tue Apr 16 04:18:42 GMT 2024

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

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

Back to the top