Questions tagged as 'hibernate'

4
answers

Error when executing hibernate

After catching a little, I'm walking with my project. When I run the project, I get the following error: mai 16, 2016 6:41:22 PM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation INFO: HHH000204: Processing PersistenceUni...
asked by 17.05.2016 / 02:44
2
answers

What is the difference between EmbeddedId and IdClass in Hibernate?

I have read in the Hibernate 5.0 documentation that you can implement composite primary keys using two forms. The first one is using the @IdClass annotation and imitating the IdClass attributes in the original class. The other is using th...
asked by 14.06.2018 / 18:07
2
answers

How hibernate.hbm2ddl.auto works?

What values can I use in this property? ex: Update <prop key="hibernate.hbm2ddl.auto">update</prop> How does it work? When should I use it? is it a good practice?     
asked by 05.10.2015 / 17:15
3
answers

How to perform TDD using Hibernate

I would like to know how to do TDD using Hibernate . I was informed that this ORM stores memory before writing to the possible, so I wanted to know how to test a data that is in memory. For example: do I execute the save command and test to see...
asked by 19.02.2014 / 23:33
1
answer

Optimistic Lock; Why not throw an exception?

I tried to simulate an optimistic Lock situation where you try to update the same record twice, but the exception is not triggered. I think it's interesting that even after changing the value of the holder and giving a MERGE, the version valu...
asked by 28.02.2017 / 21:25
2
answers

How to resolve this 'java.lang.IllegalArgumentException: Unknown entity' when running this simple application?

I'm new to the Hibernate world and when I run this application, I get the following exception: java.lang.IllegalArgumentException: Unknown entity: com.nataniel.api.domain.User at org.hibernate.ejb.AbstractEntityManagerImpl.persist(Abstrac...
asked by 27.11.2016 / 02:42
2
answers

What is JPA's mappedBy for?

Example: @OneToMany(mappedBy = "chemical", fetch = FetchType.LAZY) @LazyCollection(LazyCollectionOption.EXTRA) @JsonIgnore private List<SimulationChemicals> simulationChemicals; Why is the use of mappedBy mandatory or important? I...
asked by 08.01.2016 / 18:23
2
answers

Syntax error when creating table in PostgreSQL using Hibernate

@Entity public class User { @Id @GeneratedValue private int id; private String name; private String email; private String sex; private int age; private Date birthday; private Date registerdate; private...
asked by 12.11.2014 / 15:20
1
answer

Size of a Java String + Hibernate

Is there any way to persist a string with no size limit for the bank using hibernate? If I map my class and not limit the field, hibernate automatically creates a 255-character limit. I could give a larger limit, but ideally the field would h...
asked by 19.09.2014 / 22:24
1
answer

How to map two equal entities with Hibernate

I have a scenario where I have the entities Pedido and Usuário . The Pedido is composed of some attributes, among them the requestor that is mapped as follows: @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "usuario...
asked by 13.12.2016 / 13:20