Java 未找到com.models.entities.OrderEntity类型的属性u

Java 未找到com.models.entities.OrderEntity类型的属性u,java,spring,log4j,Java,Spring,Log4j,我收到了错误找不到类型com.models.entities.OrderEntity的属性u,我一辈子都不知道如何调试它的来源。我猜有些映射是不正确的 我尝试启用了log4j,它只提供了org.hibernate的详细信息。我尝试添加其他包,但它们没有被读取。我相信我的log4j.properties在正确的位置 log4j.属性内容: log4j.rootCategory=DEBUG, stdout log4j.appender.stdout=org.apache.log4j.Consol

我收到了错误
找不到类型com.models.entities.OrderEntity的属性u
,我一辈子都不知道如何调试它的来源。我猜有些映射是不正确的

我尝试启用了
log4j
,它只提供了
org.hibernate
的详细信息。我尝试添加其他包,但它们没有被读取。我相信我的
log4j.properties
在正确的位置

log4j.属性
内容:

log4j.rootCategory=DEBUG, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %t %c:%L - %m%n

log4j.category.org.springframework.data=DEBUG,stdout
log4j.category.com.models.entities =DEBUG,stdout
如何确保log4j记录正确的包

我的实体:

@Entity
@Table(name = "`Order`")
@NamedQueries({
        @NamedQuery(name="Order.findByUUID", query="SELECT o FROM OrderEntity o WHERE o.uuid = :uuid"),
        @NamedQuery(name="Order.findByInProduction", query="SELECT o FROM OrderEntity o WHERE o.inProduction = :inProduction")
})
public class OrderEntity {
    private Integer id;

    @javax.persistence.Column(name = "id", nullable = false, insertable = true, updatable = true, length = 10, precision = 0)
    @GeneratedValue
    @Id
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    private String uuid;

    @javax.persistence.Column(name = "uuid", nullable = false, insertable = true, updatable = true, length = 128, precision = 0)
    @Basic
    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    private Boolean inProduction;

    @javax.persistence.Column(name = "in_production", nullable = false, insertable = true, updatable = true, length = 0, precision = 0)
    @Basic
    public Boolean getInProduction() {
        return inProduction;
    }

    public void setInProduction(Boolean inProduction) {
        this.inProduction = inProduction;
    }

    private Timestamp updated;

    @javax.persistence.Column(name = "updated", nullable = true, insertable = true, updatable = true, length = 19, precision = 0)
    @Basic
    public Timestamp getUpdated() {
        return updated;
    }

    public void setUpdated(Timestamp updated) {
        this.updated = updated;
    }

    private Timestamp created;

    @javax.persistence.Column(name = "created", nullable = false, insertable = true, updatable = true, length = 19, precision = 0)
    @Basic
    public Timestamp getCreated() {
        return created;
    }

    public void setCreated(Timestamp created) {
        this.created = created;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        OrderEntity that = (OrderEntity) o;

        if (created != null ? !created.equals(that.created) : that.created != null) return false;
        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (inProduction != null ? !inProduction.equals(that.inProduction) : that.inProduction != null) return false;
        if (updated != null ? !updated.equals(that.updated) : that.updated != null) return false;
        if (uuid != null ? !uuid.equals(that.uuid) : that.uuid != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (uuid != null ? uuid.hashCode() : 0);
        result = 31 * result + (inProduction != null ? inProduction.hashCode() : 0);
        result = 31 * result + (updated != null ? updated.hashCode() : 0);
        result = 31 * result + (created != null ? created.hashCode() : 0);
        return result;
    }

    private VendorEntity vendor;

    @ManyToOne
    @javax.persistence.JoinColumn(name = "vendor_id", referencedColumnName = "id", nullable = false)
    public VendorEntity getVendor() {
        return vendor;
    }

    public void setVendor(VendorEntity vendor) {
        this.vendor = vendor;
    }

    private ShippingDestinationEntity shippingDestination;

    @ManyToOne
    @javax.persistence.JoinColumn(name = "shipping_destination_id", referencedColumnName = "id", nullable = false)
    public ShippingDestinationEntity getShippingDestination() {
        return shippingDestination;
    }

    public void setShippingDestination(ShippingDestinationEntity shippingDestination) {
        this.shippingDestination = shippingDestination;
    }

    private Collection<OrderCustomFieldEntity> orderCustomFields;

    @OneToMany(mappedBy = "order")
    public Collection<OrderCustomFieldEntity> getOrderCustomFields() {
        return orderCustomFields;
    }

    public void setOrderCustomFields(Collection<OrderCustomFieldEntity> orderCustomFields) {
        this.orderCustomFields = orderCustomFields;
    }

    private Collection<ProductEntity> products;

    @OneToMany(mappedBy = "order")
    public Collection<ProductEntity> getProducts() {
        return products;
    }

    public void setProducts(Collection<ProductEntity> products) {
        this.products = products;
    }
}
@实体
@表(name=“`Order`”)
@命名查询({
@NamedQuery(name=“Order.findByUUID”,query=“从OrderEntity o中选择o,其中o.uuid=:uuid”),
@NamedQuery(name=“Order.findByInProduction”,query=“从OrderEntity o中选择o,其中o.inProduction=:inProduction”)
})
公共类OrderEntity{
私有整数id;
@Column(name=“id”,nullable=false,insertable=true,updateable=true,length=10,precision=0)
@生成值
@身份证
公共整数getId(){
返回id;
}
公共无效集合id(整数id){
this.id=id;
}
私有字符串uuid;
@Column(name=“uuid”,nullable=false,insertable=true,updateable=true,length=128,precision=0)
@基本的
公共字符串getUuid(){
返回uuid;
}
公共无效setUuid(字符串uuid){
this.uuid=uuid;
}
私有布尔生成;
@Column(name=“in_production”,nullable=false,insertable=true,updateable=true,length=0,precision=0)
@基本的
公共布尔getInProduction(){
生产回报;
}
public void setInProduction(布尔inProduction){
this.inProduction=inProduction;
}
私有时间戳更新;
@Column(name=“updated”,nullable=true,insertable=true,updateable=true,length=19,precision=0)
@基本的
公共时间戳getUpdated(){
更新的回报;
}
公共作废设置日期(时间戳更新){
this.updated=已更新;
}
创建私有时间戳;
@Column(name=“created”,nullable=false,insertable=true,updateable=true,length=19,precision=0)
@基本的
公共时间戳getCreated(){
创建回报;
}
已创建公共void集(已创建时间戳){
this.created=created;
}
@凌驾
公共布尔等于(对象o){
如果(this==o)返回true;
如果(o==null | | getClass()!=o.getClass())返回false;
OrderEntity,它=(OrderEntity)o;
if(created!=null?!created.equals(that.created):that.created!=null)返回false;
如果(id!=null?!id.equals(that.id):that.id!=null)返回false;
if(inProduction!=null?!inProduction.equals(that.inProduction):that.inProduction!=null)返回false;
if(updated!=null?!updated.equals(that.updated):that.updated!=null)返回false;
如果(uuid!=null?!uuid.equals(that.uuid):that.uuid!=null)返回false;
返回true;
}
@凌驾
公共int hashCode(){
int result=id!=null?id.hashCode():0;
result=31*result+(uuid!=null?uuid.hashCode():0);
result=31*result+(inProduction!=null?inProduction.hashCode():0);
result=31*result+(已更新!=null?已更新。hashCode():0);
result=31*result+(已创建!=null?已创建。hashCode():0);
返回结果;
}
私人卖主实体卖主;
@许多酮
@javax.persistence.JoinColumn(name=“vendor\u id”,referencedColumnName=“id”,nullable=false)
公共供应商实体getVendor(){
退货供应商;
}
公共作废设置供应商(供应商实体供应商){
this.vendor=供应商;
}
私人托运目的地私人托运目的地;
@许多酮
@javax.persistence.JoinColumn(name=“shipping\u destination\u id”,referencedColumnName=“id”,nullable=false)
公共ShippingDestinationEntity getShippingDestination(){
返回目的地;
}
公共无效设置shippingDestination(ShippingDestinationEntity shippingDestination){
this.shippingDestination=shippingDestination;
}
私有集合字段;
@OneToMany(mappedBy=“订单”)
公共集合getOrderCustomFields(){
返回订单自定义字段;
}
public void setOrderCustomFields(集合orderCustomFields){
this.orderCustomFields=orderCustomFields;
}
私人收藏产品;
@OneToMany(mappedBy=“订单”)
公共收藏产品(){
退货产品;
}
公共产品(收集产品){
这一点。产品=产品;
}
}
堆栈跟踪:

Caused by: org.springframework.data.mapping.PropertyReferenceException: No property u found for type com.models.entities.OrderEntity
    at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:75)
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327)
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:353)
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307)
    at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:271)
    at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:245)
    at org.springframework.data.repository.query.parser.Part.<init>(Part.java:72)
    at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:180)
    at org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:260)
    at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:240)
    at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:71)
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:57)
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:90)
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:162)
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:68)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:279)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:147)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:153)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:43)
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
    ... 26 more
原因:org.springframework.data.mapping.PropertyReferenceException:找不到com.models.entities.OrderEntity类型的属性u
位于org.springframework.data.mapping.PropertyPath.(PropertyPath.java:75)
位于org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327)
位于org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:353)
位于org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307)
位于org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:271)
位于org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:245)
位于org.springframework.data.repository.query.parser.Part.(Part.java:72)
位于org.springframework.data.repository.query.parser.PartTree$OrPart.(PartTree.java:180)
位于org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:260)
位于org.springframework.data.repository.query.parser.PartTree$Predicate.(PartT
@Repository
public interface OrderRepository extends JpaRepository<OrderEntity, Integer> {
    OrderEntity findByUUID(@Param("uuid") String uuid);

    List<OrderEntity> findByInProduction(@Param("inProduction") Boolean inProduction);
}