hibernate

StaticAliasToBeanResultTransformer

Hi all, I am using hibernate search 1.1. I want to apply ResultTransformer operation post query to match the targeted data structure. But i cannot be able to find that class(StaticAliasToBeanResultTransformer) in the hibernate search jar. Where can i find this class?. Thanks, ...

Hibernate "PreInsertEvent.getSource()" NoSuchMethodError.

Hi I'm recieving the following error when trying to do inserts: java.lang.NoSuchMethodError : org.hibernate.event.PreInsertEvent.getSource()Lorg/hibernate/event/EventSource; I've seen other people with the same problem due to incompatibility in hibernate jars, but I believe I've got it right (according to the compatibility matrix)...

Java - getting jar dependencies right

Hi I'm relatively new to Java & maven, and so to get to know my way around, I decided to do a project as a means for learning. I picked a pretty common stack : Java 1.6 Hibernate (with annotations) Spring (with annotations) JUnit 4 Tomcat Oracle XE / In-mem hsqldb By far one of the biggest problems I've experienced is getting the ...

Hibernate using an instance of javax.sql.DataSource

Is it possible to configure Hibernate to use a javax.sql.DataSource instance? My application already has an instance of javax.sql.DataSource and I'd rather not re-configure the database url, user, password, driver etc just for hibernate. ...

How do I manually open a hibernate session?

I have a rather large project involving spring and hibernate. Right now, I'm backing certain objects out of hibernate and into memory, and I've hit a sort of snag. I have the following setup. Class A contains a number of primitives and a class B. B contains primitives and a class C, which was previously lazy-loaded. Now I have this ...

eclipsen hibernate tool reverse engine fail

when i run, i get java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 Index: 0, Size: 0 just like error faced by many other users at http://www.mail-archive.com/[email protected]/msg50006.html anyone what caused the error? ...

Hibernate NHibernate - Native SQL

Trying to delete an unmapped class/record via the NHibernate sql api. But can't seem to get it working. Does anything look wrong with this? session = NHibernateHelper.GetCurrentSession(); tx = session.BeginTransaction(); using (tx) { session.CreateSQLQuery("DELETE FROM tb_category WHERE parentID = :p...

how to get value form 2nd table with out join in hibernate

hi i have a table called CHECKPRODUCT. i also has 2nd table called CHECKSTATUS_LOOKUP with column name DESCRIPTION while i am getting values from CHECKPRODUCT, i also want value from DESCRIPTION column of 2nd table(CHECKSTATUS_LOOKUP) but i dont want ot join both tables. is there any ways to do that ...

How can I chop down a transaction in Spring with JPA?

I have this code: run big query: Select all unprocessed objects from table A for each result create or update an output object in table B update input object: Set it to "processed" I'd like to have a transaction over the loop body, that is after one row of input is processed, the updated objects should be committed, so when th...

NHibernate property formula filter

Hi, I have a following class: MyClass public virtual int Id { get; set; } public virtual int Code { get; set; } public virtual int Description { get; set; } public virtual int Name { get; set; } with the following mapping: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TestAp...

Will hibernate update the database when a persistence instance has been set but not changed?

If I have an instance of a persistence object, and I set some members in like so: MyThing thing = session.get(MyThing.class, id); thing.setSomething(thing.getSomething()); session.update(thing); Will this actually cause hibernate to issue an SQL update command to refresh the record? Or is hibernate smart enough to know that the objec...

Detached Objects in Jdo/Hibernate - What are they for anyway?

Can some explain to me what is the advantage of using detached objects within the context of a web application? AFAIK they are only useful if the objects somehow outlive the "lexical" scope of the transaction, but typically in a web app when your transaction is over you just send your objects to the view layer, and they will not be reatt...

getting started with envers + hibernate (simple and COMPLETE example)

I have Hibernate working and would like to try adding Envers audit/revision functionality but can't seem to figure out what is required. (my example compiles and runs OK and I get the regular Hibernate functionality but no audit tables appear in my database.) Has someone out there done this before? Does it work with H2 database using HSQ...

Hibernate - Same result after update/select

Hi, hibernateSession.createQuery("select foo where id = 1"); // This command return the Item with id 1. // [BREAK POINT STOP] ==> I go in MySQL and I delete this item manualy. // [BREAK POINT CONTINU] hibernateSession.createQuery("select foo where id = 1"); // This command return the Item with id 1 too ! :-( It's the same with hibern...

Why would Spring's HibernateTemplate's loadAll() method generate updates for each row?

I have a database table consisting of countries. In my DAO which extends HibernateDAOSupport the following method... public List<Country> getCountries() { return getHibernateTemplate().loadAll(Country.class); } ...generates the following activity: Hibernate: update countries set name=?, iso_alpha_2=?, iso_alpha_3=? where id=? Hiber...

Why does query caching with Hibernate make the query ten times slower?

I'm currently experimenting with EJB3 as a prestudy for a major project at work. One of the things I'm looking into is query caching. I've made a very simple domain model with JPA annotations, a @Local business interface and a @Stateless implementation in an EJB-JAR, deployed in an EAR together with a very simple webapp to do some basi...

Interceptor's getEntityName is not used. Bug in Hibernate?

Hi All, I implemented getEntityName method in my interceptor. I was expecting that the method will be called by Hibernate to resolve entity name of a (transient) object when I save the object. However, the method getEntityName from the interceptor was not used in the following scenarios: 1) session.saveOrUpdate was called with some en...

understanding Jasper Reports and Hibernate and parameters

Hello, I'm sorry this is a little bit of a bad question since my problem is that I just don't understand which approach to take for this. I've got this hibernate database that works great and I want to use jasper reports to create reports based on the data from it. I have iReport working and connecting to the hibernate configuration an...

understanding JasperReports and JRBeanCollectionDataSource...

I now have my jasper reports working from my JRBeancollectionDataSource in my code! I am just a bit confused about some things... When I am designing reports in iReport, I create the fields from a query, which I can do fine and all, since when I am actually running the query I'm using a a code JRBeanCollectionDataSource and so is the h...

how to do hibernate mapping for table or view without a primary key

Anyone knows how to do hibernate mapping for table or view without a primary key? thanks. ...