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

Equivalent of @Size(max = 80) in hbm xml file for bean validation

I need to know the equivalent of @size annotation used in hibernate model classes, which we can use in the hbm.xml file. Little background : So I ran into this problem where a column size is specified as 255 in the database and I have restricted…
rj4u
  • 87
  • 10
0
votes
1 answer

How to handle tables created at runtime with hibernate?

I need to create tables at runtime based on the classname of an Object my tool receives in input. e.g. if I receive an instance of the class User (with fields firstname, lastname, address) I have to create a table for that class (with column…
sirnino
  • 437
  • 3
  • 13
0
votes
1 answer

How to run Nhibernate ICriteria query with setFetchMode(Lazy) when lazy=false defined in HBM?

I'd like to run a criteria query with lazy many-to-one associations. Those associations are set as lazy="false" in the HBM. It's because we use it eagerly 90% of the project. But there are a few 'big' queries that should run as…
0
votes
0 answers

How to use Hibernate-Envers without .class files for entities

In my application I am using hibernate with only hbm files.I don't have .class files for entities. I have to implement auditing for the entities. Since I don't have .class files, I cannot use @Audited annotation. How to achieve this using hbm…
SDJ
  • 899
  • 1
  • 7
  • 14
0
votes
1 answer

Mapping many-to-one with composite-id

I am trying to map a composite key with a many to one relationship. How to map a class A which own a composite id of 4 elements and a class B which own a composite id of 3 elements to realize a joint between these class both with the…
polo
  • 1
  • 1
0
votes
1 answer

Increases the length of a column in hbm file of hibernate

I have to increase the size of a email body column in hbm file. This Column shows warning Data too long for column 'EMAILBODYCONTENT'
0
votes
1 answer

How to override S#arp architecture automapping with HBM files?

I'm facing problems with composite keys in S#arp architecture. Anyone have an example of how to do that or how to use mapping files with automapping?
0
votes
3 answers

How to export hbm xml files using s#arparchitecture with fluent mappings

This question was asked before but the answers all show how to export the hbm files from fluentnhibernate. We are using S#arpArchitecture which wraps fluent. I am able to export the schema but what I really want is the xml files to troubleshoot…
Maggie
  • 1,546
  • 16
  • 27
0
votes
0 answers

hibernate template foreign key method to insert

I am having two hbm files employee.hbm.xml and admin.hbm.xml and its corresponding entity classes.I did Many to One mapping when i try to insert the value the value is getting inserted but the update query is also executed.I am using hibernate…
M.Prabhu
  • 127
  • 1
  • 2
  • 13
0
votes
1 answer

Generating Hibernate composite key object from hbm file

(Parenthetical rant:) I'm a Hibernate beginner getting slightly frustrated by the overhead of a simple join that I could write in 15 seconds in SQL. (End rant) The situation is thus: I have 2 tables that both contain the same composite primary key -…
WhyGeeEx
  • 459
  • 1
  • 5
  • 19
0
votes
1 answer

Mapping two columns to same column in a lookup table using hibernate hbm file

I am working on an application that saves employee data using jsf 1.2, richfaces 3.3, for ORM i am using hibernate 3. I am saving data in 'Employee' basic table about two fields i.e Present City and Permanent City. The City values come from a lookup…
jaykio77
  • 379
  • 1
  • 7
  • 22
0
votes
0 answers

Accessing property from property file in hbm file

I am trying to access one property which is basically a DB name from a property file in the hbm file. Can this be achieved:
0
votes
1 answer

Query syntax exception in hibernate

MisRecords.java @Entity @Table(name="dat_emprecords") public class MisRecords { @Id @GeneratedValue @Column(name="pk_EmpRec_Idx") int id; @Column(name="EmpRec_EmpFName") String firstName; …
saurabh
  • 237
  • 6
  • 20
0
votes
0 answers

Hibernate: I want "on inserting into Table T1 , I want another column to be updated using a foreign key" . How is it possible?

Hibernate: I am inserting data into a table T1(a,b) , I want to update 'd' in table T2(a,c,d,e) using foreign key 'a'. How to write the hbm mapping file in both. It's a one-to-one relation. Table T1(mac_id, cust_id) Table T2(a,b, mac_id,c,…
Gompa
  • 1
  • 3
0
votes
0 answers

Cannot fetch a one to one child using hbm.xml configuration

I've two tables, one is User and another one is Employee User: public class User { private int id; private String userName; private String password; private Employee employee; // Getter and…
The Coder
  • 2,562
  • 5
  • 33
  • 62