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
2
votes
0 answers

entity mapping: convert from hbm.xml to orm.xml, missing fields and attributes

I´m new to hibernate and I must convert the Entity Mapping in an application from hbm.xml to orm.xml. My Problem is that I am missing some fields and attributes to convert correctly. this is the hbm.xml which I´m trying to…
ecutioner
  • 61
  • 2
  • 6
2
votes
1 answer

Fluent NHibernate (1.2.0.712) export mappings to HBM not working / not respecting conventions

The HBM export function in Fluent NHibernate does not seem to work. If I call FluentMappingsContainer.ExportTo, the generated mappings come out incorrect, and I get the following exception: FluentNHibernate.Cfg.FluentConfigurationException: An…
mindplay.dk
  • 7,085
  • 3
  • 44
  • 54
2
votes
1 answer

Get user data between two date in Hibernate Java

i have an hibernate entity called user.I want to get the list of users who are between two dates a date interval. Example, I have a date D1 and I want to know the people hired between my hiDate and my depDate. Here is the mapping of the hibernate…
ln3106
  • 113
  • 10
2
votes
1 answer

Why NHibernate uses NVARCHAR instead of VARCHAR ignoring column type mapping?

When I run the following code: List result = session.CreateCriteria() .Add(Expression.Eq("Object_id", pObjectId)) .List().ToList(); } NHibernate generates the following SQL query: exec sp_executesql N'SELECT…
GrumpyRodriguez
  • 649
  • 5
  • 12
2
votes
0 answers

Hibernate mapping doesn't allow null timestamp

I am developing a web based application using spring-hibernate combination with Mysql as a database. I have observed 1 problem with hibernate mapping that it doesn't allow me to set null, when type is timestamp. Here is code snippet for better…
Badal
  • 4,078
  • 4
  • 28
  • 28
2
votes
1 answer

Doubly connected ordered tree mapping using NHibernate

We need to map simple class using NHibernate: public class CatalogItem { private IList children = new List(); public Guid Id { get; set; } public string Name { get; set; } public CatalogItem Parent { get;…
Artem Tikhomirov
  • 21,497
  • 10
  • 48
  • 68
2
votes
0 answers

Getting a Java.lang.NullPointerException while creating Hibernate Mapping File(hbm.xml)

I am getting java.lang.NullPointerException while creating hibernate mapping file(hbm.xml). I am using Eclipse IDE 2020-06 and JBoss Tools 4.16.0 final. pom.xml
Sai Phani
  • 21
  • 3
2
votes
3 answers

NHibernate - illegal access to loading collection

I have two entities, Customer and Account. A Customer has many accounts. My mapping for Customer is :
JMc
  • 971
  • 2
  • 17
  • 26
2
votes
1 answer

Hibernate HBM Mapping Problem

I have the following three classes: public class Student { private Integer studentId; private StudentSchool studentSchool; private School school; public Integer getStudentId() { return studentId; } public void…
David
  • 299
  • 2
  • 6
  • 16
2
votes
1 answer

Hibernate inheritance update problem when generate HT table

I have a problem about Hibernate 4.3.11 , I have two pojos : X and Y that Y extends X , Actually Y is a subjoin class in X.hbm . When i excute this update on Y pojo , All of the Y records have updated ,but I want to update Y where id is 123 This…
M.Minbashi
  • 244
  • 1
  • 3
  • 12
2
votes
0 answers

how to set default value in hbm.xml of a type "numeric_boolean"

I'd like to ask how to set the default value in hbm.xml of the type numeric_boolean please I tried with default="true" or default="1", it didn't work. Someone can help…
quan
  • 21
  • 1
2
votes
1 answer

Hibernate 5.2: how to map set of enums by name using hbm file

I looking for a solution (or documentation) to map enum by hbm file but i find only solutions with annotations. I am wondering if it is possible with a hbm file. This is my hbm file.
2
votes
1 answer

Fluent Nhibernate and Custom Collections

I have the following Fluent NHibernate configuration... public class TemplateMap : ClassMap