Skip to content
Advertisement

Tag: hibernate

Single return type in Hibernate Search

Let’s say I have an app with many different entities, which do not have relations between each other. I would like to create a search that queries all of them, but returns a unified type, i.e: So my idea was to index the entities and put their values into one single index (with same index fields): As you can see,

Empty CLOB instead of NULL in Oracle CLOB field

Writing null string into Oracle CLOB field using Hibernate sometimes result in an empty CLOB instead of NULL in the field. Table STEP with a mix of varchar2, number and CLOB fields once was extended with a new CLOB field. and a corresponding field was added to entity All work as expected when non-null value stored. But when new record

Hibernate how to commit transaction even when exception pops up

i have a method in Service A And another method in Service B My problem is that when “repository.insertRandomValue()” throws ConstraintViolationException for example, then even tho it was caught in catch(), the thread ends with I have tried setting the propagation to REQUIRES_NEW and tried to set up transaction manager and GlobalRollbackOnParticipationFailure to false. I want it to simply ignore

Spring Boot Hibernate creates tables with wrong names

When I run my project, the Hibernate creates automatically tables with wrong names. I have two tables User and Role and also three classes: abstract class IdField.java: User.java class: and Role.java class: And Hibernate creates two tables with wrong names as id_field and id_field_roles: but I want table names as it is in @Table annotation like “user” and “role” Answer

Criteria API how to write = ANY(?1) expression?

I have a query that I want to translate to Criteria API. A query After java processes it (native sql query) the final query looks like this My Question is how to translate = ANY(?1) part to Criteria API? I see that any() definition is How to put array of values to it? I’m using PostgreSQL Answer You will need

@IndexedEmbedded on class containing other @IndexedEmbedded fields

I’m trying to manage hibernate search indexing on a class with a field mapped by @IndexedEmbedded on a custom @Embeddable entity. This entity also contains others @IndexedEmbedded fields in the @MappedSuperclass. These are the entities involved: And these classes: When running the application, Hibernate Search throws the following error: I’m running it with the following dependencies: Any suggestion on how

Advertisement