Я пытаюсь использовать класс проекции в методе хранилища данных Spring. Но я получаю сообщение об ошибке «Не удалось найти PersistentEntity» при попытке достичь конечной точки. Не знаю, почему это происходит. Может кто-нибудь пролить свет на это...
ошибка
org.springframework.data.mapping.MappingException: Couldn't find PersistentEntity for type class com.bugfix.api.provider.entity.projections.IncidentLatestProjection!
Класс репо
public interface UpdatedIncidentRepository extends CrudRepository {
@Query(" select new com.bugfix.api.provider.entity.projections.IncidentLatestProjection(" +
"d.IncidentId,d.IncidentName,d.alm) from UpdatedIncident d" +
" inner join Updatedparent u on u.parentId=d.parent.parentId where d.parent.parentId=:parentId ")
List testing(@Param("parentId") Integer parentId);
}
Класс проекции
@Data
@AllArgsConstructor
@NoArgsConstructor
public class IncidentLatestProjection {
private Integer IncidentId;
private String IncidentName;
private String alm;
}
Класс сущности
@Entity
@Table(name="Incident_v")
@NoArgsConstructor
@AllArgsConstructor
@Data
public class UpdatedIncident implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name="Incident_id")
@JsonProperty("IncidentId")
private Integer IncidentId;
@Column(name="Incident_name")
private String IncidentName;
private String alm;
//bi-directional many-to-one association to parent
@ManyToOne
@JoinColumn(name="parent_id")
private Updatedparent parent;
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... -data-rest
Не удалось найти ошибку PersistentEntity при использовании прогнозов в весенних данных. ⇐ JAVA
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как использовать $exists в методе производного запроса для mongodb в весенних данных
Anonymous » » в форуме JAVA - 0 Ответы
- 25 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как использовать $exists в методе производного запроса для mongodb в весенних данных
Anonymous » » в форуме JAVA - 0 Ответы
- 27 Просмотры
-
Последнее сообщение Anonymous
-