Inheritance in mongoDB spring boot

Consider the following situation:
UzERn

I want to do this in mongoDB spring boot I extend child class but it doens’t work, Can some one help me to solve this issue please.
User.class

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Document(collection =  "Utilisateur")
public class Utilisateur {

    @Id
    private String id_user;
    private String login;
    private String password_user;
    private String Nom;
    private String Prenom;
    private String email;
    private int telephone;


    @DBRef
    private Adresse adresse;
}

Admin.class

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "admin")
public class Admin {

    @DBRef
    private Utilisateur user;



}

Admin.Repository

@RepositoryRestResource
public interface AdminDao extends MongoRepository<Admin, String> {

}

Hey @keltouma,

Have you posted to the wrong forum perhaps?

This is not a general MongoDB Forum, but rather the Flowable forum.

Cheers,
Filip

1 Like

Thank you a lot :slight_smile: