简体   繁体   中英

EclipseLink JPA converter subclasses doesn't work

I use payara5 (with EclipseLink). It looks like I can't use subclasses with a JPA converter. With wildfly (and Hibernate), it works fine.

@Override
public List<Employee> findByStatus(Employee.Status status) {
    return em.createNamedQuery("Employee.findByStatus", Employee.class)
        .setParameter("status", status)
        .getResultList();
}

It's definitely a bug in EclipseLink.

Fortunately, there is a workaround. The AttributeConverter interface must be added to the subclass. It's totally useless as the superclass already implements it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM