spring-data-jpa

    10热度

    2回答

    我正在使用Spring Data JPA并试图将查询添加到我的存储库。我试图只是生成查询,而不@Query注释,如: List<Item> findByTypeAndStateOrStateAndStartDateBetween(Type type, State s, State s2, Date startDate, Date endDate); 我的目标是建立一个查询,像这样: selec

    2热度

    1回答

    我正在使用jpa查询,我可以找到适当的解决方案。我希望你能帮助我。我将开始描述我的模型。我有一个属于公司的资源。该公司有许多分支机构。该资源已关联了一些资源所有权配置。资源所有权描述哪些分支可以使用该资源以及该配置有效的一段时间。但是,如果没有指定分支机构,则该公司的所有分支机构都可以使用该资源。 这里是模型。 getter和setter省略 @Entity public class Resou

    3热度

    1回答

    有没有人有一个想法如何使用Spring Data JPA并使用Spring 3.1.0/3.1.1? Spring Data JPA 1.0.3依赖于spring 3.0.5,所以当我添加弹簧数据jpa作为依赖关系时,我得到了一个冲突,因为我使用的是3.1.0。 我试过使用maven排除,但一直没有太大的成功。

    1热度

    2回答

    我看到很多关于spring jpa的实现技术(jpatemplate,japda支持spring-data-jpa,本地方式entitymanager,HibernateSupport,ect),这是开发Generic DAO的最佳技术,应该是清洁的资源分配,事务管理和高性能。 有什么利弊 场景 实体> 70 web应用程序和web服务 未来OSGi的支持和多种数据源

    0热度

    1回答

    我有一个已开发并作为依赖项添加到我们的项目中的组件...我需要使用该组件中指定的实体,并且必须这样做使用Spring data-jpa项目中的MergingPersistenceUnitManager。 该组件定义了一个persistence.xml,其中的unitName与使用它的父项目相同。 现在,我有两个persistence.xml文件,两者都是在使用MergingPersistenceU

    1热度

    2回答

    我想在项目中使用Spring数据JPA与2数据库。但异常被触发时,我试图运行应用程序: 07:21:47.734 [main] ERROR o.s.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error crea

    13热度

    5回答

    : @MappedSuperclass @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) @DiscriminatorColumn(name="animalType",discriminatorType=DiscriminatorType.STRING) @QueryExclude public abstract class An

    3热度

    1回答

    我使用Spring + Jersey来构建API服务。 最近,我尝试将Spring数据并入我的服务器。 我还没有真正使用任何存储库在我运行的代码,只需添加一行在我app.xml中: <jpa:repositories base-package="destiny.web" entity-manager-factory-ref="entityManagerFactoryApp" /> 但是!我发现

    9热度

    2回答

    我能够使用查询缓存与Spring数据JPA为我的自定义查询方法,如下所示。 public interface CountryRepository extends JpaRepository<Country, String> { @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") }) Country

    35热度

    4回答

    我配置并运行了spring-data和hibernate。我可以使用spring-data保存记录,但出于某种原因,我无法运行将更新表中所有布尔字段的查询。 我尝试这样做: @Query("update Content v set v.published = false where v.division = :division and v.section = :section") void un