hibernate

what's the possible solution to build a app host(such as wordpress.com or google group) in java?

Hi All, I'm wondering how wordpress.com or google group host multiple applications for different party. For wordpress, I guess it will create a subdomain for each user and configured a virtual host in Apache for this installation. Of course, a database is installed for this user (or tables with prefix). Will the wordpress application ne...

Persisting a set of Days of the Week

I'm looking for an efficient way to persist a set of Days of the Week. In other words, a user will select any number of days from a list of weekdays. The specific date doesn't matter, just the day of the week. I need to store this set of days in a hibernate entity. I could store one of these: Set<DayOfWeek> Set<Integer> But I'm thi...

How to write select queries for paginating output from ManyToMany attributes

I have a Group table with ManyToMany relationship with the User table via a join table. A Group could contain a lot of users or could contain sub groups containing more users. I am using JPA, Hibernate 3.3 How do I paginate the results returned by Group.getUsers() which could be either users obtained via Group.getUsers OR could be all...

Spring HibernateDaoSupport : lazy-loading problem ?

Greetings, In my domain model, 'Family' has many 'SubFamily's 'SubFamily' has many 'Locus's and relationships are bi-directional with lazy-loading. ie. 'Locus' can access in parent 'SubFamily' using alocus.getSubFamily(); Down below snippet I have given the DAO method to retrieve a Locus . In my webapplication (Wicket based) I g...

Hibernate one-to-one mapping problem.

Hello I've the following class: public class Movimenti implements java.io.Serializable { private Integer id = null; private Integer idCommessa = null; private String nomemovimento = null; private Movimento preventivato = null; private Movimento effettivo = null; public Movimento getEffettivo() { return effettivo; } public void se...

How to map these classes with Hibernate?

Suppose I've these 2 classes: class A{ B ref1 = null; //Can both be null B ref2 = null; } class B{ .. } I'm omitted the getters and setters for ref1 and ref2. Of course I want to add ids... Anyway what I want is to have hibernate handle automatic persistence of these two references... and to have automatic deletion of ...

Why this simple hibernate sample doesn't work?

I wrote these two classes: public class ClasseA { Integer id; String numero; ClasseB cb; public ClasseB getCb() { return cb; } public void setCb(ClasseB cb) { this.cb = cb; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; ...

How to temporarily disable read-only 2nd level cache hibernate strategy in Grails ?

In my grails application, some of my domain classes will never be changed by Users. However, some maintenance work is sometimes necessary, and administrator should be able to create/edit few instances from time to time (let's say twice a year). I would like to set a read-only 2nd level cache strategy for these domain classes (static ma...

Many-to-Many link tables in grails (GORM) / hibernate

Hi Guys, I'm playing aroud with Grails and am finding the ORM stuff tedious because I don't fully understand what I'm doing when it comes to domain classes. I'm hoping someone can put me back on track Consdier the the following Test Job One:Many Hardware Used on Job Many:One Physical Hardware ...this is analogous to the cla...

Synchronization between hibernate running locally and on a server

Is there an easy way using a library to facilitate the synchronization of two hibernate instances. One running locally on a client and one running on a central server exposed via a web service. So Client tracks changes it makes, pushes them to the Server. The server ensures that the clients is not updating out of sync objects and stores...

OutOfMemory when reading big amounts of data using hibernate.

I need to export big amount of data from database. Here is classes that represents my data: public class Product{ ... @OneToMany @JoinColumn(name = "product_id") @Cascade({SAVE_UPDATE, DELETE_ORPHAN}) List<ProductHtmlSource> htmlSources = new ArrayList<ProductHtmlSource>(); ... } ProductHtmlSource - contains big s...

Hibernate and strange behavior with DB2 sequences

I am using Hibernate with Spring and DB2. I am using sequences to generate primary key for entities. All entities use the same sequence HIBERNATE_SEQUENCE, which is the hibernate default. The problem is that values that end up into primary keys are about 10 times higher than those returned by the HIBERNATE_SEQUENCE. For example this si...

Hibernate Reference column in table to indicate how to unmarshall an attribute in a different column in the same table

Hi, I have an entity that I want to persist through Hibernate (3.2) The EntityBean has a column that indicates how another value of the entity bean should be unmarshalled: <class name="ServiceAttributeValue" table="service_attribute_value"> <cache usage="nonstrict-read-write"/> <id name="id" column="id" type="int-long"> ...

how to configure hibernate 3.3 in eclipse galileo?

i am working on galileo but i am not able to find the plugin for hibernate 3.3 can anybody send me the plugin link please. it's urgent. and also send me the spring 2.x latest version plugin also. Thanks in advance, Bhuvan Yadav. ...

help in my project for undestanding workflow

Hi I have newly joined a company. They have given me the application and asked me to study the workflow. But I dont know wherenthe flow starts and how it goes. Pls someone help me. The project desc is My project is doing simple addition and deletion to the database. Its using the technologies Spring,hibernate,EJB and some WSDL files a...

Relation many-to-many with attributes : how ?

Hi, Excuse me for my poor english in advance as it is not my mother tongue. Like in this example: http://www.xylax.net/hibernate/manytomany.html But i have in the table foo-bar 2 attributes which are not part of the primary or foreign keys.: one boolean(A) & one string(B). I know how to map it without attributes but not in this case. ...

Hibernate/HQL - how to get all duplicates returned from database?

I've got a table containing some duplicates (defined as some specific columns contain the same values). What's the best way to get all those rose back? I need all the duplictes, so group by in combination with having count() > 1* is not the way I'd like to go. So if my table contains the following data 1 - foo - bar - something 2 - foo...

Strange update issue with hibernate when inserting non-related entity

Hi I have set of hibernate mapping classes like User/Role/Menu etc I also have other set of classes like Table/Column/Evv etc. These two sets are not directly related to each other however we have the UI framework which identify which Menu is associated with Table and load columns and Evv for that. All these objects are cached in rea...

Properly Implementing a One to Many Unidirectional Relationship in Hibernate

I'm trying to learn how to use Hibernate to implement Java Object Persistence. Specifically, I'm trying to figure out how to implement a unidirectional one to many mapping. I've read the hibernate documentation and the numerous Stackoverflow questions on the subject and they are not entirely clear, so I'd like to know what the correct ...

Hibernate Criteria and multiple join

is possible with Hibernate criteria do it? select A.something, B.something, C.something, D.something from A JOIN B on A.id = B.id_fk JOIN C ON B.id = C.id_fk JOIN D ON C.id = D.id_fk; ...