Entity Embedded In Morphia

0

I would like to know if there is a way to make an entity "@Entity" and at the same time to embed it "@Embebbed" in morphia.

Possible code attachment

@Embedded
@Entity
public class Perfil {

    @Id
    private ObjectId id;

but when doing this, throw the following exception:

  

Exception in thread "main"   org.mongodb.morphia.mapping.validation.ConstraintViolationException:   Number of violations: 1 EmbeddedAndId complained about   cl.psasoluciones.SistemaDe Comisisiones.modelo.MORPHIA.Profile. :   @Embedded classes can not specify @Id field

Does anyone know if it can be done?

    
asked by Daniel Piña Rivera 10.07.2018 в 16:03
source

0 answers