DEV Community

Xavier Font
Xavier Font

Posted on

Create list of objects inside the class of which the object from which the list is made belongs to

0

I AM USING SPRING BOOT

I want to create a List<User> friends;inside the User class itself :0 !!!

I get this error 'Element Collection' attribute value type should not be 'Persistence Entity'

Here is my code:

import javax.persistence.*
    import javax.sql.rowset.serial.SerialBlob;
    import javax.validation.constraints.Email;
    import javax.validation.constraints.NotBlank;
    import javax.validation.constraints.Size;
    import java.util.List;

    @Entity

Top comments (0)