Hi
In my project i m using using hibernate and oracle as DB.
I am having two tables with foreign key relationship.
In hibernate I m have one-to-many relationship.
my one-to-many code
set name="classname" cascade="all,all-delete-orphan
one-to-many ..... on-delete="cascade"
set
But whenever i detele i am getting constraint violat...
One of the requirements of my project is to log who (which Staff) updated what (from what version to what version). UI needs to show who updated entity X at what time and what are updated.
What is the cleanest way to implement this?
For discussion purpose, imagine... Account has a Contact, and I need to store who update the contact, w...
Given all the smarts around Hibernate and it's various caching strategies, how do I know if a certain operation is resulting in a physical database hit, or coming from the cache?
...
Hi
I'm writing a DAO using spring and hibernate
public class DaoImpl extends HibernateDaoSupport implements Dao {}
For reading or updating data I'm using HQL getHibernateTemplate().bulkUpdate(...) but one of the queries is too complex for that and I need to use native SQL Query query = getSession().createSQLQuery(...)
But doing tha...
Stepwise, what would be a good way of integrating Spring and Hibernate into an existing JSF application that doesn't use ORM?
...
Hi,
Let's say I have following classes. (only most important things included)
public class Client {
/* Some Properties */
}
public class ClientDocumentAssociation {
@ManyToOne
private Client client;
/* Some Properties */
}
@Indexed
public class Document {
@OneToOne
private ClientDocumentAssociation clientAsso...
I am developing an application in struts 1.2 framework.
I want to use hibernate full text search in my application.
How can I use it?
...
We are using Apache Derby 10.5.3.0_1 and hbm2ddl with Hibernate 3.3.x
I get the following constraints error while pre-loading the SQL on an embedded derby database. If I remove the primary key(id) from the create table sql, it's able to create the table. Not sure what the problem is over here.
create table user_flow (id integer not nul...
Say, i have an entity that has a history of operations as a collection. I want to sort entities by the date of the latest operation (it's the first element of history).
i'd like to do something like this:
criteria.addOrder(Order("history[0].date"))
is this possible?
...
I noticed that the Grails hibernate plugin does not support the hibernate load function? Does anybody know why that is? In all of the documentation that I have seen, it seems that the accepted way to delete an object from a db is to do a get() with the object id followed by a delete(). While this works it makes an unnecessary database...
Hello,
I'm having a frustrating problem with my Grails application. I'm able to run the application using both run-app and run-war without any issues, but when I try to deploy to a container, I get an exception that I'm not sure how to interpret. I've tried deploying on Glassfish, Tomcat, and Jetty, and I have the same issue in all thre...
I'm trying to use the HQL Console feature of Intellij IDEA for interactively debugging HQL. We use JPA with Hibernate as the provider.
I've configured the JPA Facet for the module as per this, as well as a DataSource. The HQL console seems to know about my entities, as it can auto-complete them in the console. But whenever I try a q...
what configuration parameters or session preferences need to set to fix Can't write to a readonly object ? Here is the stacktrace for more information
Caused by: java.lang.UnsupportedOperationException: Can't write to a readonly object
at org.hibernate.cache.ReadOnlyCache.lock(ReadOnlyCache.java:43)
at org.hibernate.acti...
I've been learning how to build projects using Roo and am making good progress. I have the nucleus of a project which correctly displays my defined entities and allows me to create, edit, and delete the representative objects. I am using mysql at the database and I see that objects entered using the UI correctly appear in the mysql dat...
According to this section of the Hibernate documentation I should be able to query any java class in HQL
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html#queryhql-polymorphism
Unfortunately when I run this query...
"from Transaction trans where trans.envelopeId=:envelopeId"
I get the message "Transaction is n...
Is it necessary that composite-id should be mapped to class ??
can it be like this ?
<composite-id>
<key-property=..../>
<key-property=..../>
</composite-id>
or should be
<composite-id class=....>
<key-property=..../>
<key-property=..../>
</composite-id>
should that necessary that if we have composite key then that class ...
Hi I am able to add record but not able to delete record.
It gives the following error:
[ERROR] 2010-02-20 13:38:16 (JDBCExceptionReporter.java:logExceptions:78) ORA-02292: integrity constraint (BANKNET.FK_DDA_DEAL_ADVISOR) violated - child record found
[ERROR] 2010-02-20 13:38:16 (AbstractFlushingEventListener.java:performExecutions:3...
hi when i try to execute the query
SELECT DISTINCT DECODE (pd.pr_l50_nm , 'ADVISORY', 'Advisory' , 'EQUITY', 'Equity' , 'DEBT', DECODE (pd.pr_cd, 'BOND-HY', 'Leveraged Finance', 'Debt') , 'LOANS', DECODE (pd.pr_cd, 'IG',
'Loan', 'Leveraged Finance')) EXCO_PRODUCT_NM FROM ibk_dw.PRODUCT_DIM pd WHERE pd.pr_hcy_nm = 'STANDARD' AND ...
Hi folks,
I have two tables in the clients mssql database. The first is a job table - so I created an Job entity which contains the load type and load weight and all that stuff - works fine.
My problem now is that there is a second table that includes informations about the load and unload point. The second table, I call it JEP, has a...
I receive following error when i save the object using hibernate
object references an unsaved transient
instance - save the transient instance
before flushing
Can you help me ?
...