Hi

Which config do you use for the access mode?

Which version also?


Le 12 avr. 2017 20:49, "DonatasCiuksys" <[email protected]> a
écrit :

I have JPA entity class Student and simple REST service (see code bellow).
Note that I have annotated @ManyToMany field with @JsonbTransient and
@JohnzonIgnore annotations (because it courses infinite loop during
serialization to JSON).
Yet this doesn't help, TomEE tries to convert this ManyToMany field to JSON
and fails because of cyclic dependencies.

It seems either we have a regression (
https://issues.apache.org/jira/browse/JOHNZON-68
<https://issues.apache.org/jira/browse/JOHNZON-68>  ) or some
misconfiguration.

@ApplicationScoped
@Path("/student")
@Produces(MediaType.APPLICATION_JSON)
public class StudentRestService {

    @Inject private EntityManager em;

    @GET
    @Path("/{studentId}")
    @Transactional
    public Student find(@PathParam("studentId") Integer studentId) {
        return em.find(Student.class, studentId);
    }
}


@Entity
@Getter
@Setter
@EqualsAndHashCode(of = "registrationNo")
@ToString(of = {"id", "firstName", "lastName", "registrationNo"})
public class Student implements Serializable {
    ...

    @ManyToMany
    @JsonbTransient
    @JohnzonIgnore
    private List<Course> courseList = new ArrayList<>();
}



--
View this message in context: http://tomee-openejb.979440.
n4.nabble.com/Annotations-JsonbTransient-and-JohnzonIgnore-do-not-work-
tp4681537.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Reply via email to