Questions tagged [hbm]

A Hibernate (and NHibernate) feature that allows for both HQL and SQL queries to be stored in a file

A Hibernate (and NHibernate) feature that allows for both HQL and SQL queries to be stored in a file ending with *.hbm.xml. The main advantage is that your query is precompiled when the application starts up, and any errors in the query can be caught ahead of runtime.

165 questions
0
votes
1 answer

Hibernate Mapping : delete children in one to many bidirectional mapping in hibernate

I have a parent object and its detail object. The mappings are mentioned in the below code - Parent Object Mapping
0
votes
1 answer

Foreign key in compiste primary key (duplicated column error)

We are just integrating Hibernate in our web application which has been developed since today using direct queries to a relational database. We have generated hbm.xml files in order to have all the entities and mappings implemented for accessing…
Yeti
  • 1
0
votes
1 answer

Hibernate (hbm) - refreshing set with where clause after merging the container object

I'm working with Hibernate 4.3.5, Java 1.6 and Spring 4.0.3. I've mapped the entities through hbm, and I want my application works with logical deletion. So, in each mapped entity, I've added a property named 'deleted', which indicates if an entity…
Víctor Pariente
  • 381
  • 2
  • 6
  • 18
0
votes
1 answer

Hibernate get entity name value

There are 2 tables that are mapped to 1 class. This works but when I want to update the object I don't know from which table it came. Is there a way to store or get the entity name? Mapping:
ThijsJ
  • 1
  • 2
0
votes
1 answer

Why wont hibernate create this my table?

I'm getting this error out when attempting to create a table through hibernate. I can include the relevant files if necessary. What is likely the cause, and how can I go about fixing it? INFO: HHH000227: Running hbm2ddl schema export Hibernate: drop…
James
  • 223
  • 1
  • 6
  • 15
0
votes
1 answer

Hibernate JPA how to convert list-index hbm attribute to annotations?

I want to convert an existing hbm file to a JPA entity via annotations. the following is the hbm code i want to convert it into annotation:
Moussi
  • 470
  • 6
  • 16
0
votes
2 answers

Delete element from Set

I have 2 classes Tema(Homework) and Disciplina (course), where a Course has a Set of homeworks. In Hibernate i have mapped this to a one-to-many associations like this:
AdrianS
  • 1,980
  • 7
  • 33
  • 51
0
votes
1 answer

Hibernate - Query multiple tables with one hibernate-mapping

I do have a hibernate mapping which looks like this:
Stix
  • 455
  • 5
  • 16
0
votes
1 answer

Hibernate hbm xml mapping of non-existing property

Is it possible to use non-existing property in Hibernate xml mapping? So I can have nonExisting column in my DB, but not in my class. I also need to use Hibernate criteria…
karolkpl
  • 2,189
  • 10
  • 39
  • 60
0
votes
1 answer

Nhibernate Many to many: 3 tables hbm mapping

I have many to many relationship. Table A, Table B and table AB. Table AB will include 2 columns, A_Id and B_id.. The primary key need to be from the both of the column. Many B records can refer to one A record. But for each record in B only one A…
Shir
  • 253
  • 1
  • 6
  • 18
0
votes
1 answer

Setting the default orderby for an entity in the mapping file?

Is it possible to set the default order-by column to use in the NHibernate mapping file? Unless explicitly defined I want to order all specific entities by the Name column automatically. I've seen that it can be done on collections but thats not…
Luke Smith
  • 23,504
  • 8
  • 29
  • 28
0
votes
1 answer

Why is hbm.xml configuration is followed by hibernate when I use both hbm.xml and annotation to configure the same data?

Thanks a lot in advance. :) I am using Hibernate 4.3.5. I wrote a Hibernate application. I configured table name and name of one of it's columns,in hbm.xml file as well as using annotation. When I ran the application the table created was having the…
Arjun Thakur
  • 351
  • 5
  • 13
0
votes
1 answer

HBM Hibernate many-to-many bidirectional connection with extra column

i googled a lot and did follow many tutorials about it, but i didnt get it to work. I have a many-to-many relation between the table Player and Type. Both tables are connected via typeperplayer. In the table typeperplayer is an additional column…
holzleube
  • 159
  • 1
  • 2
  • 10
0
votes
1 answer

Hibernate - values vs. values

I'm back here in Stackoverflow wondering what the difference is between values in and within a Hibernate's hbm.xml file. I explain myself a little better:
kazbeel
  • 1,378
  • 19
  • 40
0
votes
1 answer

Which hibernate class loads the tables of hbm files

Recently i upgraded to hibernate 4 and found that there are some constraints loading each time server is started. I wanted to know how this table constraints are added through hibernate. Which hibernate class loads the table properties such as table…
Sanket
  • 612
  • 5
  • 23
1 2 3
10
11