Проблема Selma Mapping появляется при импорте сущности в мой DAO? - PullRequest
0 голосов
/ 21 апреля 2019

У меня проблема, моя сборка не удалась, поэтому я пытаюсь вставить данные в таблицу из dao, поэтому вот мой код сущности java:

@Entity
@Table(name = "declaration_type", uniqueConstraints = 
@UniqueConstraint(columnNames = { "declaration_id", "type_id" }))
@Getter @Setter
public class DeclarationTypeEntity implements Serializable {

   private static final long serialVersionUID = 5424823478701291072L;

   @EmbeddedId
   @AttributeOverrides({
        @AttributeOverride(name = "declarationId", column = @Column(name = "declaration_id", nullable = false)),
        @AttributeOverride(name = "typeId", column = @Column(name = "type_id", nullable = false)) })
   private DeclarationTypeId id;

   @Column(name = "declaration_id", insertable = false, updatable = false)
   private Long declarationId;

   @Column(name = "type_id", insertable = false, updatable = false)
   private Long typeId;

   public DeclarationTypeEntity(Long dec, Long type) {
    this.declarationId = dec;
    this.typeId= type;
   }

}

И вот где я импортировал свою сущность, чтобы я мог ее использовать:

package com.apicil.cosy.contrat.dao.api.hibernate.impl;

// other importations here .. but this one is causing the problem
import com.apicil.cosy.common.domain.contrat.DeclarationTypeEntity;

@Repository
public class TypesContratDaoImpl extends AbstractDaoImpl<Object, Long> implements TypesContratDao  {

   @Autowired
   private TypesContratDaoJPA typesContratDaoJPA;
   @Autowired 
   private DeclarationTypeDaoJPA declarationTypeDaoJPA;

   @SuppressWarnings({ "unchecked", "rawtypes" })
   @Override
   public CrudRepository getCrudRepositoryImpl() {
    // TODO Auto-generated method stub
    return null;
   }

   @Override
   public List<Type> getTypesContratDao() {
    // TODO Auto-generated method stub
    return getJPAQueryFactory().selectFrom(QType.type).fetch();
   }

   public void getTypesByDeclaration() {

   }

   public void ajouterUnTypeAuContrat() {
    declarationTypeDaoJPA.save(new DeclarationTypeEntity(1,5));
   }

   public void supprimerUnTypeDeContrat() {

   }


}

Когда я удаляю свой StatementTypeEntity из своего класса дао, сборка прошла успешно, это ошибка, которую я получаю:

Failed to generate mapping method for type com.apicil.cosy.common.domain.contrat.DeclarationTypeEntity to com.apicil.cosy.common.domain.contrat.DeclarationTypeEntity not supported on com.apicil.cosy.generateur.service.api.DocumentMappingHandler.clonnerLeDocument(com.apicil.cosy.generateur.domain.Document) !
[ERROR]   --> Add a custom mapper or 'withIgnoreFields' on @Mapper or @Maps to fix this ! If you think this a Bug in Selma please report issue here [https://github.com/xebia-france/selma/issues].

Я не знаю, как решить эту проблему, я провожу с ней слишком много времени, я новичок в Spring boot и хотел бы получить помощь, спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...