hibernate Questions

4

i work with a spring-boot project, <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.4.RE...
Witherspoon asked 17/11, 2020 at 7:26

3

Solved

The database I'm working on has more than 100 tables, so I'm not going to sit here baking a model and controller for each one individually. I would like to bake all of the tables at the same time w...
Pounds asked 19/9, 2013 at 15:44

3

Solved

According to the documentation, the following usage is deprecated: @GenericGenerator( name = "UUID", strategy = "org.hibernate.id.UUIDGenerator" ) One shall use the new type...
Tirrell asked 19/7, 2023 at 16:12

6

Solved

public class SequenceControlNumber extends SequenceGenerator { private static final Logger log = LoggerFactory.getLogger(SequenceGenerator.class); @Override public Serializable generate(Sessi...
Underplot asked 19/9, 2012 at 13:8

2

I have some JPA classes and generate metamodel through org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor. So, one of my classes is: @Table(name = "USER") @Entity @NamedQueries({@NamedQuery(nam...
Unfounded asked 20/4, 2016 at 13:36

3

Solved

Our project use's Hibernate's programmatic Configuration to set up our SessionFactory and such. I just migrated us from version 3 to version 4 of Hibernate. Now I am getting the error "Element type...
Deflection asked 14/6, 2013 at 17:25

2

I am new to Java and maven. I might be missing something obvious, but I am not able to figure it out. I was trying to add javax validations to my project following the link : https://www.baeldung.c...
Swaziland asked 29/11, 2020 at 15:16

3

Solved

Consider and Employee and Address relationship. There is a One-to-one mapping between Employee and Address. Following are models: @Entity @Table(name = "Address") public class Address { @Id @Gen...
Moynahan asked 18/2, 2014 at 11:30

4

I'm using the JPA CriteriaBuilder to select entities of type MyEntity from a MySQL db as follows: String regExp = "(abc|def)" CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery query = cb...
Kosiur asked 28/7, 2014 at 13:1

8

I have to ask it, I almost tried everything. Entity Class @Entity @Table(name="UserInfo") public class User { @Id@Column(name="user_name") private String userName; @Column(name="user_id") ...
Getaway asked 7/12, 2015 at 7:12

5

Solved

package com.abc.def.model; import javax.persistence.Column; import javax.persistence.Id; import javax.persistence.Entity; import javax.persistence.Embeddable; import javax.persistence.IdClass; imp...
Ballast asked 12/10, 2012 at 14:26

3

We have a fairly complex data model and are using Hibernate and Spring Data JPA on top of MySQL. We have a base class that all domain objects extend to minimize boiler plate code. I would like to b...
Worthless asked 5/1, 2012 at 15:42

8

I am trying to build a web application, I didn't add any classes or packages I have just ran the app but it says java.lang.NullPointerException: Cannot invoke "org.hibernate.engine.jdbc.spi.Sq...
Forerunner asked 1/11, 2023 at 22:30

4

Solved

Hibernate Gradle plugin is an equivalent of hibernate-enhance-maven-plugin and offers build-time code enhancements. The official docs do not mention the apply plugin: 'something' line. If I just do...
Healion asked 22/2, 2016 at 11:11

2

Solved

I have fairly typical scenario where there is a main @Entity and everything inside him is embeddable (so everything inside doesn't make sense without the parent). Now JPA 2.0 is blocking me to nest...
Bowe asked 2/3, 2014 at 10:24

3

Solved

I have a problem with Hibernate @EmbeddedId. @Embeddable public class EnrolRegEmbededId implements Serializable { @Column(name="ENROL_NO") private String enrolNo; @Column(name="REG_...
Boutte asked 31/8, 2018 at 7:43

4

I have rest crud service which will help me make post and get requests and receive respopnses from sql server , inside my application.properties i use similar data: server.port=9004 spring.datasou...
Hight asked 30/1, 2018 at 13:13

8

Solved

With Hibernate, can you create a composite ID where one of the columns you are mapping to the ID can have null values? This is to deal with a legacy table that has a unique key which can have null...
Ottie asked 16/9, 2008 at 10:7

4

Solved

In my Hibernate JPA Sample code.. public List<AttendeesVO> addAttendees(String searchKeyword) { TypedQuery<AttendeesVO> query = entityManager.createQuery(" select at from AttendeesVO ...
Pyrrhic asked 2/1, 2013 at 9:0

4

We decided on using optimistic locking in our web application in order to increase concurrency and without the using of pessimistic locking. We are now on a lookout for retry solutions. We would ...
Sackett asked 10/2, 2014 at 8:44

12

Solved

If I run multiple threads against my web app I get: java.sql.SQLException: [SQLITE_BUSY] The database file is locked (database is locked) at org.sqlite.DB.newSQLException(DB.java:383) at org.sql...
Chapbook asked 15/12, 2012 at 9:24

13

Solved

I am a novice in hibernate world and facing, WARN: GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement org.hibernate.tool.schema.spi.CommandAcceptance...
Civilization asked 14/4, 2017 at 7:47

3

Solved

this is my config: spring.jpa: hibernate: ddl-auto: update connection: charset: utf8 useUnicode: true properties.hibernate.dialect: org.hibernate.dialect.MySQL5InnoDBDialect Based on what ...
Willamina asked 10/6, 2017 at 9:15

3

Solved

I am using hibernate-envers with spring. Everything works just fine, except when I delete an entity, it does not change the values of updated_by and updated_date inside audit table, instead it save...
Grinder asked 13/11, 2019 at 8:48

2

Solved

I have an existing web-app and unfortunately the 'time' fields in the DB are not converted to zulu time. Instead we are using org.joda.time.DateTime as our datetime and timezone encapsulator. I am ...
Sternberg asked 15/4, 2021 at 14:59

© 2022 - 2024 — McMap. All rights reserved.