hibernate

many domains = much memory usage ?

Hi, I would like to know if for example, I have about 80 domains on my projects, does it means that the 80 domains will be loaded into memory when I run the project or it will be loaded when I need that domain ... It seems if I have many domains in one project, I have to disable auto compile and increase the perm gen space. is there ...

Configure hibernate (using JPA) to store Y/N for type Boolean instead of 0/1

Can I setup JPA/hibernate to persist Boolean types as 'Y'/'N' in the database (the column is defined as varchar2(1)). It currently stores them as '0'/'1'. The database is Oracle. ...

JBoss Scoped Class Loading

I want to use the latest hibernate version inside the ear without upgrading the jars on the server. I am following the instructions given here - http://jaitechwriteups.blogspot.com/2008/08/how-to-upgrade-hibernate-in-jboss.html. However the problem now is the application is not taking the jboss-local-jdbc.rar sitting in the deploy folde...

Mathematical operation between coulmn values in hibernate criteria

Hi, I tried to query a table using hibernate. In criteria how to apply mathematical operations in two column values? ...

can Use Hibernate and Tomcat Connection pool at same time?

Hi every one, I have a java web Application and I use Tomcat connection pooling for it, this my setting: <?xml version="1.0" encoding="UTF-8"?> <Context path="" docBase="" debug="5" reloadable="true" crossContext="true"> <Resource name="jdbc/jdbcPool" auth="Container" type="javax.sql.DataSource" maxAc...

Spring user transaction with hibernate

I want to control hibernate transaction myself so I can rollback at any time. I calling a thread to do business but not waiting for it to finish its job and update DB. This update is only available when the method ends but I want to commit changes in each for loop so I need to control hibernate transaction. My Sample code is below: for...

hibernate manytomany xdoclet

is this the right way of using it? because it does not work. i have the same thing in the RoleDAO. the two tables for users and roles are generated, but the table that links userid to roleid is not. (more info on the syntax bellow http://xdoclet.codehaus.org/HibernateTags#HibernateTags-hibernate.manytomany hibernate xdoclet tags) /** ...

problem with select Double in Hibernate

Hi every one, I have problem when want read object with where (double variable) this is my Code : BranchBuilding Table: @Entity @Table(name = "branchbuilding", uniqueConstraints={@UniqueConstraint(columnNames={"buildingname","branch_fk"})})//uniqueConstraints={@UniqueConstraint(columnNames={"username","buildingname"})} public class Bra...

Hibernate Save Object Question

Hi every One, I have these class : @Entity @Table(name = "branch", uniqueConstraints = {@UniqueConstraint(columnNames = {"bname", "branch_fk"})}) public class BranchEntity implements Serializable { @Id @GeneratedValue private int id; @Column(name = "username", length = 64, nullable = false) private String userName;...

HQL and one-to-many queries

I have Hibernate domain objects that looks like this: class Player { List<Item> inventory; } class Item { List<Enchantment> enchantments; } class Enchantment { boolean isSuperiorEnchantment; } I need to construct an HQL query that returns to me a list of all players that have at least one item wit...

WAS 6.1, Hibernate, Spring and transaction managmement configuration

I'm using Websphere Application Server Express v6.1 and am writing an application which uses Spring 2.0.7, Hibernate 3.5. My datasource is Oracle 10g. I have 2 question Which is a better transaction manager? Websphere's or Hibernate's? If IBM is the answer then how should I configure it in the spring config XML? This is my current d...

Hibernate flush and JTAUnexpectedRollbackException

Hi All, I am using Spring and Hibernate. And Atomikos for transactions. I use annotation based transactions. I am having a DAO object and in one of the methods I call entityManager.persist() to save the object. Now whenever there is an ORA- error during update, for example a constraint is violated or one of the columns is having length...

Would it be accurate to say that JAXB is to XML as Hibernate is to a database schema?

If I want an ORM that helps me to develop a "database agnostic" application, then Hibernate would be a good fit, but if I need to map entities or objects to nodes in an XML file, then JAXB would be the right type of technology... would that be a correct assessment? ...

What is org.springframework.orm.hibernate3.support.BlobByteArrayType good for?

What is org.springframework.orm.hibernate3.support.BlobByteArrayType good for?Why not map a byte[] as the Hibernate basic type "binary"? What are the differences? When to use which? Thanks! ...

how to define if domain has more than one unique field in grails?

Hi, I have domain that has more than one unique fields like the following class Shoes{ String name; Brand brand ; Color color ; Supplier supplier ; Integer size ; BigDecimal price; } name, brand, color and supplier need to be unique ... so if there are product with same name brand color and supplier it would retu...

Problem with UTF-8 in Create Schema By Hibernate

Hi every one, this is My hibernate.hbm.xml and I use MySQL <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt; <hibernate-configuration> <session-factory> <property name="hibe...

Store and retrieve Image by Hibernate

Hi every One, can any one tell me what is the best way to store and Image By hibernate (into MySQL) I have this class Mapping @Entity @Table(name = "picture") public class PictureEntity implements Serializable { @Id @Column(name = "id") @GeneratedValue private int id; @Column(name = "format", length = 8) private...

Hibernate multi level of transaction

hi every one, I have some hibernate code and I want my code run in 1 transaction let me explain in code public void changeBranch(Branch branch) throws DatabaseException { //some code humanDao.update(he); superBranchUsername = branch.getFatherUsername(); int superBranchId = branchDao.getBranchIdByUserN...

Programmatically find out if system supports standby

This happens sometimes with Windows XP installations. Unless the display drivers are installed, power saving actions such as standby and hibernate are not supported. Whether the system supports hibernate can be checked - http://pinvoke.net/default.aspx/powrprof/IsPwrHibernateAllowed.html Is there something similar for checking standby ...

Using Maven in Hibernate Tutorial

I have maven installed and I'm trying to go through the hibernate tutorial. But how exactly am I suppose to use this file: http://docs.jboss.org/hibernate/stable/core/reference/en/html/tutorial.html#tutorial-firstapp-setup What does maven need to do with it? What exactly does that file do? ...