< /blockquote>
Вот мой код: < /p>
В классе объекта пользователя, как этот < /p>
Код: Выделить всё
package com.loader.batch.IF.entity;
import jakarta.persistence.*;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@Entity
@Table(name = "data_flight")
public class UserFlight {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "MessageSequenceID", nullable = false)
private Long MessageSequenceID;
@Column(name = "MessageType", length = 30)
private String MessageType;
@Column(name = "ServiceType", length = 30)
private String ServiceType;
@Column(name = "OperationMode", length = 30)
private String OperationMode;
@Column(name = "SendDateTime", length = 30)
private String SendDateTime;
@Column(name = "CreateDateTime", length = 30)
private String CreateDateTime;
public UserFlight(
Long MessageSequenceID,
String MessageType,
String ServiceType,
String OperationMode, String SendDateTime, String CreateDateTime) {
this.MessageSequenceID = MessageSequenceID;
this.MessageType = MessageType;
this.ServiceType = ServiceType;
this.OperationMode = OperationMode;
this.SendDateTime = SendDateTime;
this.CreateDateTime = CreateDateTime;
}
public Long getMessageSequenceID() {
return MessageSequenceID;
}
public void setMessageSequenceID(Long messageSequenceID) {
MessageSequenceID = messageSequenceID;
}
public String getMessageType() {
return MessageType;
}
public void setMessageType(String messageType) {
MessageType = messageType;
}
public String getServiceType() {
return ServiceType;
}
public void setServiceType(String serviceType) {
ServiceType = serviceType;
}
public String getOperationMode() {
return OperationMode;
}
public void setOperationMode(String operationMode) {
OperationMode = operationMode;
}
public String getSendDateTime() {
return SendDateTime;
}
public void setSendDateTime(String sendDateTime) {
SendDateTime = sendDateTime;
}
public String getCreateDateTime() {
return CreateDateTime;
}
public void setCreateDateTime(String createDateTime) {
CreateDateTime = createDateTime;
}
}
< /code>
А класс службы подобен следующему: < /p>
Pageable pageable = PageRequest.of(req.getPage(), req.getLimit(), Sort.by("MessageSequenceID"));
UserFlight userFlight = new UserFlight();
userFlight.setStatus(req.getSearch());
Example example = Example.of(userFlight, SEARCH_CONDITIONS_MATCH_ANY);
var flightData = flightRepository.findAll(example, pageable);
< /code>
и исключение появляется из -за про Pagable Object не находит атрибут Messagesequenceid: < /p>
org.springframework.dao.InvalidDataAccessApiUsageException: Unable to locate Attribute with the given name [messageSequenceID] on this ManagedType [com.loader.batch.IF.entity.UserFlight]
Подробнее здесь: https://stackoverflow.com/questions/766 ... type-xxx-a