A bug of EclipseLink with Lambda expressions


references

error

GlassFish which ships EclipseLink suddenly started refusing my war file.

...Message] uses a non-entity [class ...Attachment] as target entity
    in the relationship attribute [field attachments].

new hotness

The problem is that Attachment class contains a lambda expression.

@XmlAttribute
public Long getMessageId() {
    return ofNullable(message).map(Message::getId()).orElse(null);
}

old and busted

@XmlAttribute
public Long getMessageId() {
    return message != null ? message.getId() : null;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s