Hi guys,
While a lot of posts have been written on the subject of Spring's OpenSession/EntityManagerInViewFilter, I couldn't find any that mentions its flaws. From what I understand, and assuming a typical layered web application architecture using a @Transactional service layer, the filter works as follows:
The filter intercepts a se...
Hi All,
I'm trying to mix HQL and SQl in the same query. Like using
"from ObjectA obj, TABLE_B tbl where obj.someProp = tbl.COLUMN"
because my client will need to modify the query, and learning HQL or mapping unmapped tables is out of the question :(
If not hibernate, does somebody knows another ORM tool that can accept this? another ...
Given a simple entity relationship:
@Entity
public class Single {
@OneToMany
public Set<Multiple> multiples;
}
How does Hibernate find out that the generic type of multiples is Multiple? This information is impossible to find with the standard Reflection API.
I'm looking through the source code, but don't really know where to st...
Sometimes, it's very tediously to make own configuration, find all libraries, check it ...
So, is there any ready typical (template) config for appropriative task?
...
I was wondering if there is a way to do Hibernate mapping for the following. My two days spent on this say there isn't.
There are two tables, having one to many relationship.
+---------------------+ +-----------------+
| versioned_entity | | basic_entity |
+---------------------+ +-----------------+
| fk_BasicEn...
Hi guys,
In my Spring configuration, I've asked that the session should remain open in my views:
<bean name="openSessionInViewInterceptor" class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor">
<property name="sessionFactory" ref="sessionFactory"/>
<property name="flushMode" value="0" />
</bean>
...
Is it possible to throw a specific error message in a PL/SQL oracle stored procedure and catch it in Hibernate when it gets invoked?
...
AFAIK, Hibernate transforms all sql to prepared statement form before issuing it to the database. When tuning the application, the size of prepared statement cache can be an important factor. How to determine the optimum value when using Hibernate, given that it creates prepared statements “under the hood”.
...
customer = // get customer from the current hibernate session
// customer has a discount with database id of 1
Everything is fine until here. But if I call:
discount = SpecialDiscount.create("10%");
customer.setDiscountTo(discount);
session.save(customer);
// customer has a discount with database id of 2 now
How hibernate can updat...
I will be implementing a feature to update an id in a table after Hibernate does my deletes. But I want to get some feedback on which approach is better. Also the table I am updating the value in, Hibernate doesn't know about it so I would have to do a straight jdbc update -- is that even possible.
...
I have this .hbm.xml file :
Evenement.hbm.xml :
<hibernate-mapping package="com.af.evenement">
<class name="Evenement" table="TB_EVENEMENT">
<id name="id" type="string" column="CODE_EVENEMENT">
<generator class="assigned" />
</id>
<set name="causesAnnexes">
<...
Does anyone have any experience on getting Hibernate working with ZK?
Thanks
Edit: Sorry to clarify what I am looking for:
I am looking for anyone that has experience doing this, maybe they can clarify is it easy? I have never used Hibernate before. In addition can anyone provide any resources focussed around this issue?
...
I'm looking for Hibernate annotation or .hbm.xml that allows me to specify a table column as case-insensitive string working in unicode/utf-8/locale-independent manner that works on multiple database engines.
Is there any such thing?
So that I can do query using Restrictions.eq("column_name", "search_string") efficiently.
...
java.lang.ClassCastException: org.hibernate.type.SerializableType incompatible with org.hibernate.type.EntityType
at org.hibernate.id.ForeignGenerator.generate(ForeignGenerator.java:74)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:122)
at org.hibernate.event.def.Defau...
I am facing a problem in hibernate property formula field. Not able to combine both table columns.
shift_id column belongs to parent table of job_card and duration column belongs to child table of job_card_idle_time.
but it consider both columns are belongs to parent table of job_card.
<property
name="utilization"
f...
Given I have an object A with a collection B and I want to get A with all B that fit a certain criteria
"from A a left join fetch a.bs c where a.id = ? and c.id = ?"
The above certainly won't work so there must be another fetch after I alias c so would this be correct
"from A a left join fetch a.bs c join fetch c.id = ? where a.id = ...
The system I'm working on has a domain object named Order which inherits from AbstractPersistentObject. Now I need to add another domain object named ExternalOrder which has some of the properties of Order but not all. I would like these two objects to be treated polimorphically in certain places. Hence I'm thinking of implementing inher...
What I am going to describe is a bit of legacy code. So there is a lot of stuff I cannot touch/change.
This pseudo-code runs well the in Jboss 4.0.3,
big_messy_sql = "select t1.f1 as somealias, t2.f2 as somehthingelse from obj1 t1, obj2 t2 where crazy_conditions....";
Query query = entityManager.createNativeQuery(big_messy_sql);
L...
Is anyone aware of the validity of Hibernate's Criteria.list() and Query.list() methods returning multiple occurrences of the same entity?
Occasionally I find when using the Criteria API, that changing the default fetch strategy in my class mapping definition (from "select" to "join") can sometimes affect how many references to the same...
Hi all,
My entity defines a field like
Map<String, String> props;
I've got this hibernate xml configuration
<map name="props" table="PROPS">
<key column="id"/>
<index column="name" type="string"/>
<element column="value" type="string"/>
</map>
Now I want my Map to be an EnumMap like
Map<MyEnum, String> prop...