spring-data-jpa

    0热度

    1回答

    我想将现有Spring 3 JPA 2 Hibernate Web应用程序迁移到Spring Data JPA。 然而只是加入最新的Spring数据JPA的Maven项目和配置Spring数据如下 <jpa:repositories base-package="myapp.persistence.spring" entity-manager-factory-ref="entit

    0热度

    1回答

    我一直试图解决这个问题很长一段时间没有成功。我使用: 春3.1.1 休眠4.0.1.Final 弹簧数据的JPA 1.0.2.RELEASE MySQL的5(org.hibernate.dialect.MySQL5InnoDBDialect) 我有两个实体,OneToOne无向关联。没有,我不想受到级联删除/什么作为参考 @Entity @Table(name = "UserRole") pu

    1热度

    3回答

    我使用Spring数据和Hibernate,并得到一个错误,当我试图保存集ID实体: org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist: com.snp.cm.persistency.contact.Contact; nested exception is or

    0热度

    1回答

    public interface AreaRepository extends JpaRepository<Area, Integer>, JpaSpecificationExecutor<Area>{ @Query("from Area where sup is null") List<Area> findProvinces(); @Query("from Ar

    1热度

    1回答

    在应用程序中使用Spring Data JPA时,通常需要定义实体(@Entity)并编写一个存储库接口(它扩展了CrudRepository)并执行超出范围的其他配置这个问题。 例如, @Entity public class Product { // code removed for brevity } public interface ProductRepository e

    4热度

    2回答

    我使用: 春3.1 春数据JPA 1.1 的Hibernate 4.1 我有一个问题。我有一个标准的Spring数据JPA DAO: public interface DnarDao extends JpaRepository<Dnar, Long> { // insert Spring Data magic here! } 这里是Dnar代码: @Entity @Table(n

    104热度

    7回答

    我正在研究Spring Data JPA。考虑下面的例子,我将默认使用所有的crud和finder功能,如果我想定制一个finder,那么在界面本身也可以轻松完成。 @Transactional(readOnly = true) public interface AccountRepository extends JpaRepository<Account, Long> { @Que

    3热度

    3回答

    我有以下ManyToMany映射。 @Entity public class Class1 { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "class1_class2", joinC

    2热度

    1回答

    o.s.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productfeedSvc': Injection of autowired dependen

    4热度

    2回答

    我正在采取第一次服务/存储库方法并且遇到问题。基本上我想在我的服务中做的是坚持我的实体,然后在相同的服务方法中使用它的ID。 本来我打算使用@GeneratedValue和Sequences,但放弃了手动刷新实体并获取ID,我认为这会更容易。 My Repository是一个使用Spring Data的接口,所以它支持手动刷新。据我了解,它也被注释@Transactional。我的服务方法也用@T