0
所有由hibernate POJO生成的模型,如何搜索第一个字符是大写?默认情况下它会找到“pDesc”,这是错误的。JpaRepository当变量第一个字符是大写时如何写
public interface ProductDao extends JpaRepository<Product, Long> {
public List<Product> findByPDesc(String PDesc);
//How to write if first character is upper case?
}
@Entity
@Table(name = "product", catalog="somedb")
public class Product implements Serializable {
//Some other code (constructors, getters & setters)
private String PDesc;
}
谢谢。
不能相反吗?谢谢。 –
@LeeTeongHoe如果要更改列名称,请使用注释更改它,查看更新的答案。 –
抱歉,目前我已经部分完成了超过50个表的webapp,许多变量都以大写字母开头,早期由Hibernate映射文件和POJO从数据库生成,这就是为什么默认那样。那为什么我搜索解决方案可以如何保持“PDesc”并使用JpaRepository。谢谢。 –