我将 SQL Server 数据库中的表转换为实体的类之一。
@Id
@Column(name = "[primary_key]")
private int id;
@Column(name = "[id Employee]")
private byte[] employeeId;
@Column(name = "[Period]")
private Date period;
@Column(name = "[Credit amount]")
private float creditAmount;
@Column(name = "[Type]")
private String type;
@Column(name = "[Weight 585]")
private float weight585;
和 CrudRepo (部分):
@Query(value = "select sum([Weight 585]) from [ZOK per period] where ([Period] between ?1 and ?2) " +
"and ([id Employee] = ?3) and ([Type] = 'Gold')", nativeQuery = true)
Double getSumZokGold(Date start, Date end, byte[] employeeId);
我所有的列名都是红色的,并带有两个错误:
- 无法解析列“”;
- 未知的数据库函数'';
我检查了持久性和已经分配的数据——这是这个问题最流行的解决方案。我已经检查了方言 - SQL Server。我检查了所有列名,没有发现任何错误。