我还是java和spring的初学者,我已经将表存储在名为as的mysql中Offers,我试图逐行获取数据where the Status == 0,我的表看起来像:
-------------+------------+------------+------------+--------------+--------+--------+--------+--------+--------------+
| Msisdn | Entry_Date | Start_Date | End_Date | Service_Type | Status | Parm_1 | Parm_2 | Parm_3 | Process_Date |
+-------------+------------+------------+------------+--------------+--------+--------+--------+--------+--------------+
| 7777777777 | 2019-01-11 | 2019-02-15 | 2019-03-03 | 1 | 1 | 1 | 1 | 1 | 2019-10-15 |
| 7888888899 | 2019-01-11 | 2019-02-12 | 2019-03-03 | 1 | 0 | 1 | 1 | 1 | 2019-10-15 |
| 799999999 | 2019-01-11 | 2019-02-10 | 2019-03-03 | 1 | 0 | 1 | 1 | 1 | 2019-10-15 |
| 79111111111 | 2019-01-28 | 2019-02-27 | 2019-03-03 | 1 | 0 | 1 | 1 | 1 | 2019-10-15 |
+-------------+------------+------------+------------+--------------+--------+--------+--------+--------
当我尝试运行我的代码时它返回
org.springframework.beans.factory.BeanCreationException:创建在类路径资源[org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]中定义的名为“entityManagerFactory”的bean时出错:调用init方法失败;嵌套异常是 org.hibernate.AnnotationException:没有为实体指定标识符:com.example.accessingdatajpa.Offers
优惠信息库
package com.example.accessingdatajpa;
import java.util.List;
import org.springframework.data.repository.CrudRepository;
public interface OffersRepository extends CrudRepository<Offers, String> {
List<Offers> findByStatus(String Status);
Offers findByMsisdn(String Msisdn);
}
九州编程
BIG阳
慕虎7371278
阿波罗的战车
相关分类