hibernate

hibernate

针对hibernate​和软件的用户和开发人员的问答

文章 24浏览 33
  • Spring JPA (Hibernate) No qualifying bean of type: javax.persistence.EntityManagerFactory

    SpringJPA(Hibernate)Noqualifyingbeanoftype:javax.persistence.EntityManagerFactory我正在使用Spring-boot,因此在Tomcat7中部署了一场war。当我启动应用程序时,我得到以下信息:Dec30,20137:41:06PMorg.apache.catalina.core.ApplicationContextlo…
    2025-05-311
  • org.springframework.beans.factory.UnsatisfiedDependencyException: Error created bean with name \\’bookDaoImpl\\’

    org.springframework.beans.factory.UnsatisfiedDependencyException:Errorcreatingbeanwithname'bookDaoImpl'大家!JavaEclipseMavenSpringMVCHibernateTomcat我手动创建项目https://www.boraji.com/index.php/spring-mvc-4-h…
    2025-04-161
  • 在Hibernate中禁用二级缓存的问题

    TroubleinDisablingSecondLevelCacheinHibernate我在我的应用程序中使用了ehcache。我在jbossAS7服务器中部署我的应用程序。我现在想禁用二级缓存。我已经从我的hibernate配置文件中删除了缓存属性,删除了我的ehcache.xml文件,从所有hbm文件中删除了缓存使用。当我在jboss中部署我的项目时,我可以看到启用了二级缓存。[org.hi…
    2025-04-161
  • Hibernate 中使用 Criterion 的嵌套查询

    NestedQueryinHibernateusingCriterion我有一个以下查询,我必须从子查询创建的临时表中选择行。selectx,y,xfrom(selectx,y,zfromsome_tablewherexbetweenx1andx2)whereylike'y1'orderbyzbydescDetachedCriteriasubCriteria=DetachedCriteria.fo…
    2025-04-161
  • 使用日期之间的hibernate hql/sql 连接未正确过滤

    Hibernatehql/sqljoinusingbetweendatesnotfilteringproperly我希望有人能帮助我理解为什么会发生以下情况。我正在使用hibernate和HQL,但在sqlserver或hsqldb中使用从hibernate生成的sql的结果是相同的-我的日期没有过滤我的JOINed表。问题的症结在于具有多个连接的hql查询,其中我要根据日期过滤器过滤其中一个连接…
    2025-02-101
  • Vineet Reynolds / java-ee-6-galleria 项目用 MySQL 代替 Derby 运行

    VineetReynolds/java-ee-6-galleriaprojectrunningwithMySQLinsteadofDerby我正在尝试关注/了解有关JavaEE的更多信息,并找到了一篇非常好的文章http://blog.eisele.net/2012/03/java-ee-6-running-galleria-on-glassfish.html这是如何在Glassfish上运行它的…
    2025-02-101
  • SE环境下从persistence.xml中解耦一个JPA实体jar

    DecoupleaJPAentitiesjarfrompersistence.xmlinSEenvironment有没有办法在多个SE应用程序中重用带有JPA注释实体的jar(作为依赖项)?SE环境不支持persistence.xml中的,还有其他方法吗?正式(根据规范),您必须使用class元素指定所有类。引用JSR-220的第6.2.1.6章mapping-file,jar-file,clas…
    2025-02-101
  • 最佳实践 Hibernate 乐观锁定和 Web 应用程序

    BestpracticeHibernateoptimisticlockingandwebapplication我有一个使用Tapestry5(javawebframework)和Hibernate制作的Web应用程序。现在我正在尝试添加乐观锁定。所以我添加了一个版本属性并且乐观锁定工作,所以这很容易和快速。但是由于我的Web应用程序使用"每个请求的会话"模式,我不确定使用这种乐观锁定的最佳方式是什…
    2025-02-101
  • 在JPA 2.1中对同一个表中的多个列使用List或Set

    UsingListorSetinJPA2.1formultiplecolumnsinsametable我是JPA的新手。我正在使用Wicket-Spring-Hibernate-JPA构建示例maven项目。我正在使用HibernateEntityManager:v4.3.5.Final。我正在使用JPA:v2.1-api。我正在使用数据库mySql:v5.6.在编写模型类时,我想将表的多个列与模…
    2025-02-101
  • 集群上的hibernate L2 缓存

    HibernateL2CacheonclusterQ1:只有这些vendor支持集群上的HibernateL2缓存,我说得对吗?Hibernate兵马俑(商业)SwarmCache(自2003年以来未发布)JBoss缓存1.xJBoss缓存2Q2:HibernateL2缓存有什么替代品吗?(也许是一些数据库缓存?)Q1。EhCache作为分布式的HibernateL2Cache工作得非常好。我们将…
    2025-02-101
  • Table not getting created using Hibernate Automatic Query Generation

    TablenotgettingcreatedusingHibernateAutomaticQueryGeneration低于错误Causedby:org.apache.derby.client.am.SqlException:Table/View'SO_ITEM_DTLS'doesnotexist.atorg.apache.derby.client.am.Statement.completeSql…
    2025-02-101
  • infinispan hibernate cache eviction

    infinispanhibernatecacheeviction我正在使用Infinispan6.0.0和Hibernate4.3.6。我的配置是:<!--Defaultconfigurationisappropriateforentity/collectioncaching.--><namedCachename="entity"><clusteringmode="i…
    2025-02-101
  • JPA Repository:设置符合条件的最新元素的字段

    JPARepository:setfieldofmostrecentelementthatmatchescriteria我有一个JpaRepository,它有许多匹配相同myCriteria的元素。我想更改匹配myCriteria的最新元素的布尔值。这是我的实体:@Entity@Table(name="my_entity")@Getter@Setter@NoArgsConstructor@All…
    2025-02-101
  • 如何使用Spring Data Jpa启用多租户

    HowtoenableMultitenancywithSpringDataJpa背景:我正在构建一个多租户SaaS应用程序,并选择了单一数据库、共享模式作为多租户方法。每个表都有一个鉴别列"tenantId"来隔离租户数据。我使用SpringBoot作为应用程序框架,并将SpringDataJPA用于数据层,并将Hibernate作为JPA提供程序。我真的很喜欢spring数据有助于消除样板代码的…
    2024-10-221
  • JPA 条件谓词查询结合 Integer 和 String 参数

    JPAcriteriapredicatequerycombiningIntegerandStringarguments我正在使用JPA(EclipseLink风格),框架JSF2.0,查询包含4个字段的MySQL联系人表:contactId(intPk),firstName(String),surname(String),countryId(intForeignkey)publicListData…
    2024-10-171