hibernate

Can i use Hibernate ORM framework without any restriction in Groovy and/or JRuby ?

Hi, I like Groovy/JRuby simplicity. But in order to use it, i would like to know whether Hibernate ORM framework works same way as in Java language ? Is there some limitation or restriction ? regards, ...

How Configure Hibernate for develop Test

Hi every One, we are 9 programmer work on java Web application use hibernate framework, but we have problem by running(in run mode, debug mode) project each time we want test the project we must wait for Hibernate to create SessionFactory and all Relational Query! what should i do that Hibernate Work faster? ...

Hibernate ManyToMany with Join table problems on update

Dear all, I am trying to make a ManyToMany association work for all CRUD operations I have to entities : Places and Events Places can hold multiple events and an events can take place in multiple places In first case I had In class PlaceDto @ManyToOne( targetEntity=EventDto.class, cascade = { CascadeType.PERSIST,...

Is there a way to read a Hibernate Session as RDF triples?

I need to query my local Hibernate managed datastore for persisted objects based on criteria where the relevant data for the WHERE clause is in the Linked Open Data cloud. Is there a way to read a Hibernate Session as RDF? If so, I can at least use the combined Dataset to decide what objects to retrieve from Hibernate. Preferably the s...

How to make Hibernate only query the default mapping?

I have an entity class: Cabbage.java package womble; public class Cabbage { private int id; // getters, setters, etc. } That I've got mapped to two separate database tables as follows: Cabbage.hbm.xml <hibernate-mapping> <class name="womble.Cabbage"> <!-- Using the default entity and table name. --> <id name="id" uns...

create initial data for hibernate driven testing

Hello good people! first of all thank you all for reading this. i want to populate my database (derby) every time i run the test class to be able to perform test like delete or update or deletebyid stuffs. I use <property name="hibernate.hbm2ddl.auto">create</property> in my hibernate.cfg.xml file so i'm expecting the database to be ...

Equinox (OSGi) and JPA/Hibernate - Finding Entities

I am trying to use Hibernate/Spring in an OSGi (Equinox) environment. It works great if I explicitly point it to the Entity classes in the Persistence.xml: <class>com.es.t.eee.domain.StuffSource</class> <class>com.es.t.eee.domain.PostalAddress</class> What I want is for Hibernate to "find" all of the Entity classes just as it does ...

Dynamically create table and java classes at runtime

Hi All, I have a requirement in my application. My tables wont be defined beforehand.For Example,if the user creates a form by name Student,and adds its attributes like name,roll no,subject,class etc.. then on runtime,there should be a table created by name student with columns name,roll no,subject,class and also its related class and ...

problem saveOrUpdate object Hibernate (a different object with the same identifier session)

Hi Every one, I have problem when want update my object to database using hiberntae when I want update(branchDao.update(be); ) it's throw below exception a different object with the same identifier value was already associated with the session this my code: LoginEntity le = loginDao.getSpecificLogin(pkId); le....

oracle 11g hibernate problem

Hello friends, I am changing my database from PostgreSQL to Oracle 11g. I am using hibernate 3.0 with Java and Struts. Everything is working fine with PostgreSQL. I have changed following in hibernate.cfg.xml file. <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="hibern...

hibernate sql query

hi, i have a strange problem with a hibernate sql query: The db relations are like follows: registration has one invoicerecipient registration has many attendees i have the persid of an invoicerecipient, so I should get in both following cases the associated registration, but only the second case works. Does anybody know why the firs...

Hibernate custom type definitions

Hi Can someone please advise on how to define & map (using annotations) custom types in Hibernate? Eg, given: @Entity public class Line { private Point startPoint; private Point endPoint; } public class Point { private double x; private double y; } Rather than having Point persisted as an object, I'd like to see Lin...

Using Hibernate HQL to select records where two dates are within a specified interval

I'm trying to use HQL to find records where two date fields are within 1 month of each other. Query query = session.createQuery("from com.ep.cqprojects.db.Projects " + "where active_date - kickoff_meeting_date < interval '1' month "); Unfortunately the database used apparently doesn't understand interval. How can I compare the in...

Find primary key created by Hibernate JPA

Short version: Is there a simple way to get the value of a primary key after doing a merge() in Hibernate JPA? Details: I'm making a generic library that uses Hibernate. The library uses JPA's merge() to serialize a POJO to the database. What's the best way to discover the primary key's new value? I'm assuming that the primary key ...

MFC Feature Pack Bug? Ribbon Based GUI does not restore after hibernation (sleep mode)

Hello, I've forced with a possible bug feature of MFC Feature Pack under Windows Vista. It can be easily recreated: Create a new SDI app using MFC Feature Pack (with Ribbon based interface). You can also add some floating panels if you want; Do not change anything, just build a Release; Close the Visual Studio, run the application and...

Grails + sqlite

Is there any way to use SQLite as a database storage for my Grails app? If I use a SQLite JDBC driver (http://www.zentus.com/sqlitejdbc/), my app fails to start with "Could not determine Hibernate dialect for database name [SQLite]" The only workaround I found was http://d.hatena.ne.jp/torutk/20090711/p3 (it's in Japanese, have it goog...

Java Netbeans BeanCreationException

Hi Im trying to deploy netbeans java ee project ( maven + hibernate + JSF ) on glassfish Im getting error below. My database configuration is ok ( double checked from several apps ), and database itself is ok and online. SEVERE: WebModule[/web-0.1-SNAPSHOT]PWC1275: Exception sending context initialized event to listener instanc...

help with java type erasure.

Hello good people! in my long journey to learn about hibernate, i wanted to use generic DAO and came across a good article at the hibernate site and tried out the IMPLEMENTATION WITH HIBERNATE Section.I'm having an error saying :GenericDAOImpl.java:[22,16] name clash: makeTransient(T) in GenericDAOImpl and makeTransient(T) in GenericDAO ...

Is it possible to bulk delete from a many-many association with HQL?

And if so, what is the syntax? Assume that I want an instance of Foo to be unassociated from all instances of Bar: In SQL it would simply be: delete from FOO_BAR_MAPPING where FOO_ID = ? In HQL, I assumed it would be something like: delete from Bar.foos foos where foos.id = :id (where foos is a mapped collection of Foo) But appea...

Getting duplicate entry errors from Hibernate, is MySQL to blame?

I am working on a database application which is mostly read-only, but there is one table which records user movement in the app and has a large number of writes to it. For every few thousand writes, we see a few exceptions in the error log like so: [WARN][2009-07-30 11:09:20,083][org.hibernate.util.JDBCExceptionReporter] SQL Error: 106...