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

nhibernate subclass - zero guid in not used column instead of null

I have an issue with a two subclasses using the same table and same fields. Even though the generated table has this fields as nullable uniqueidentifiers, when I save the one record that does not use the third column, then the created field has a…
jjaskulowski
  • 2,524
  • 3
  • 26
  • 36
0
votes
1 answer

how to update a column without changing the others in hibernate?

Please Help me as soon as possible. I tried with changing the hbm file configuration like dynamic-update ="true", But it is not working. Thanks in advance.
deepak
  • 1
0
votes
1 answer

Unit Testing nHibernate Mappings

I am mapping some table valued functions in nHibernate using HBM files. Our table functions have been changing quite a bit lately, so I want to make sure our mapping files are updated when these changes are made. I am able to unit test my mapping…
gwin003
  • 7,432
  • 5
  • 38
  • 59
0
votes
1 answer

Hibernate: Generating hbm.xmls using java class with EJB3 annotations

i need to create the Hibernate XML Mapping file using the java class with EJB3 annotations. I use the Hibernate Tools under Eclipse Java EE IDE for Web Developers Juno Service Release 2. for to create a Hibernate XML Mapping file like described in…
Kamen Jahr
  • 241
  • 2
  • 7
  • 15
0
votes
1 answer

Hibernate Hbm many-to-many mapping - delete the other part if don't exists relationship in many-to-many table?

I want to know if there is a way to configure hbm mapping to do something like this: when I delete the owner of a many-to-many relationship, after delete the children at the many-to-many table, delete also the entities in the other part of the…
Matheus
  • 3
  • 1
0
votes
0 answers

what hibernate parameters should i use?

I have a table DEVICE which has a unique id of DEVICEID. I have a second table called DEVICEINFO whose primary key is a sequence DEVICEINFOSEQ but this info table also has a DEVICEID field which is a foreign key pointing back to DEVICE. In the…
p0tta
  • 1,461
  • 6
  • 28
  • 49
0
votes
1 answer

How do I get NHibernate to return data on composite key table?

I have a junction table in my database. I need to read the id values and use them in my program. I cannot get NHibernate to return any records in the database. It appears as though my mapping file "compiles", but no results are…
James
  • 2,445
  • 2
  • 25
  • 35
0
votes
1 answer

Cascade not working in hibernate properly

In the below given code, cascade="save-update", is used for the Course class(bag) associated with the Student class. Student class is--> private int id; private String firstName; private String lastName; private Address address; …
KDjava
  • 2,355
  • 4
  • 17
  • 22
0
votes
1 answer

How do I resolve circular dependencies in mappings?

I have 2 tables that have a circular dependency. A Title has Elements, and in turn each Element points to the next Title in the path. However, when I call BuildSessionFactory() on my instance of NHibernate.Cfg.Configuration I receive the following…
James
  • 2,445
  • 2
  • 25
  • 35
0
votes
1 answer

avoid loading hbm files automatically

I have two databases (Oracle and SqlServer) and I have the same table (Province) in both. I'm using JPA with Hibernate and need to perform operations to any of those databases. I have an hbm mapping file for each table but both refer to the same…
0
votes
1 answer

Correct Hibernate mapping

I have a five tables and their respective column university - id_university (pk) - id_country (pk) ---- FK ---- country.id_country - univ_code - univ_name - id_update FK ---- update.id_update institute id_institute (pk) id_country…
Namita
  • 779
  • 4
  • 12
  • 24
0
votes
2 answers

Nhibernate Identity mapping when using "newsequentialid" in DB

I'm using NHibernate to map my objects to the DB. One of these object is called "Attachment". its ID is generated using the "newsequentialid" in MS SQL server 2008 (as the Default Value or Binding) to create the Guid for the id column. Now what i…
JarJarrr
  • 400
  • 3
  • 18
0
votes
2 answers

Need help createing the hbm.xml

I'm new to hibernate and I came a cross a problem. I've read all throu the starter guides etc. on the hibernate website and I still can't come up with a solution. I have a class like this: public class ResultTree { String attrName; Map
kemaleq
  • 23
  • 6
0
votes
2 answers

Hibernate: many-to-many association is empty

My app has leagues, and each league can have any number of competitions. I use .hbm.xml files to set up an association between leagues and competitions. I've configured it as follows:
Marvo
  • 17,845
  • 8
  • 50
  • 74
-1
votes
1 answer

hibernate - share mapping xml files

Is there a way to share mapping files for multiple tables. Every hibernate pojo has a Integer id field which i moved into a superclass. I also have multiple tables which are very similar to each other. So i created superclasses for those either. …
djmj
  • 5,579
  • 5
  • 54
  • 92
1 2 3
10
11