For questions related to Hibernate's XML mapping files.
Questions tagged [hibernate-xml-mapping]
8 questions
4
votes
4 answers
How to cast one object into another
I am a beginner in Java and have below 2 Beans/POJOS in my existing company application:
User
public class User {
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String…

ghostrider
- 2,046
- 3
- 23
- 46
1
vote
0 answers
Sometime getting org.hibernate.StaleStateException when calling delete after update
org.hibernate.StaleStateException
Is thrown sometimes (not consistent) in unit test case.
The normal flow is:
Create
Update
Delete
StaleStateException is thrown while executing delete operation.
The entity has child entities with one to many…

Gaurav
- 3,615
- 2
- 27
- 50
1
vote
0 answers
Specify @column(name=tempname) in application.properties file
I am using spring-boot and hibernate.I want to externalize entity column names in application.properties file or xml file. something like,
in entity class,
@Column(name = @Value("${tablename.prop1value}")) //not possible
private String prop1;
in…

user8413857
- 11
- 3
1
vote
0 answers
Mapping a map collection containing superclasses in Hibernate
I am trying to map a map collection of String, SuperClass using XML mapping files. Here's what I have:
1
vote
1 answer
Map complex value objects in Hibernate
I've already asked this question on the Hibernate's forum, but I thought I'd ask it here too.
I'm trying to map the following model while preserving the value semantics of the TranslatedText and Translation value objects:
Both values as dependent…

plalx
- 42,889
- 6
- 74
- 90
0
votes
1 answer
Is there a possibility to reference another class via value object
How can I make a many-to-one xml mapping from the stayId of RoomOccupancy to the stayId of Stay. Note that StayId is a value object, therefore it does not contain the whole reference to Stay.
public class RoomOccupancy {
// generated hibernate…

Whosayin20
- 81
- 1
- 10
0
votes
1 answer
0
votes
1 answer
Repeated column in mapping for entity in hibernate XML mapping
I have been facing an issue of "Repeated column in mapping for entity". Could you kindly help me where i have done mistake on it. I have mentioned my code below.
USERAUDIT.hbm.xml

Giridharan
- 4,402
- 5
- 27
- 30