Hi, I'm quite new to hibernate and have stumbled on this problem, which I can't find solution for.
When persisting parent object (with one-to-many relationship with child), the foreign-key to this parent is not stored in child's table.
My classes:
Parent.java
@javax.persistence.Table(name = "PARENT")
@Entity
public class PARENT {
p...
Hello.
I have a problem when I try to persist my model. An exception is thrown when creating the EntityManagerFactory:
Blockquote
javax.persistence.PersistenceException: [PersistenceUnit: ASD] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
...
Hi,
Assume I have an entity Foo in the DB.
I am parsing some files and creating new Foo objects and would like to check if the parsed Foo object exists in the DB (using a unique attribute). If it exists already update it otherwise save as a new object.
What is the best approach?
Could I simply set the id and version in the new Foo ...
Hi,
I am using hibernate-2.1 and "net.sf.hibernate.SessionFactory" class in my spring project.
Now I am switched to Spring 2.5.6.A, where they are using hibernate3 and I am not able to find out the "net.sf.hibernate" package in that.
But I found SessionFactory class in the package "org.springframework.orm.toplink".
Is both the class ...
I am trying to map an entity as following
@OneToOne(mappedBy = "localizedLabel")
@JoinColumn(insertable = false, updatable = false)
@WhereJoinTable(clause = "locale='en_US'")
public Localization getEn_US() {
return en_US;
}
I can assure that the data will return only one or null if the not found, but hibernate seems to ignore my @...
Can Hibernate 3.5.x be used as the JPA provider instead of the default provider in the latest version of Google App Engine (1.3.2)
...
I am currently in the process of upgrading an application from Hibernate 3.2 to Hibernate 3.3. I though I'd stick with the default connection pool (Hibernate changed its default from Commons DBCP to c3p0) as I don't have any good reason to choose a non-default pool. At least non but having used DBCP before.
The upgrade went pretty much...
Hi
I want to display image to the client side , but the problem is my image is stored in database in Blob format .
Can u help me?
...
We are using hibernate in a new project where we use the hibernate.reveng.xml to create our *.hbm.xml files and POJOs after that. We want to have equals methods in each of our POJOs.
I found that you can use <meta attribute="use-in-equals">true</meta> in your hbm files to mark which properties to use in the equals. But this would mean e...
I have a problem with the mapping of Oracle Float double precision datatype to Java Double datatype. The hibernate schema validator seems to fail when the Java Double datatype is used.
org.hibernate.HibernateException: Wrong column type in DB.TABLE for column amount. Found: float, expected: double precision
The only way to avoid this ...
I have a situation in which the ideal relationship, I believe, would involve Value Object Inheritance. This is unfortunately not supported in NHibernate so any solution I come up with will be less than perfect.
Let’s say that:
“Item” entities have a “Location” that can be in one of multiple different formats.
These formats are comp...
I have a table containing primary key and foreign key that references same table.
How can I implement this mapping in hibernate...
structure of tables is as follows..
Dept (
deptno pk,
dname,
location
)
employee (
empid pk,
ename,
Manager Id Foregin key references Employee(empid),
deptno Foregin key referen...
Let's say we have a "Question" and "Answer" entity,
@Entity
public class Question extends IdEntity {
@Lob
private String content;
@Transient
private int answerTotal;
@OneToMany(fetch = FetchType.LAZY)
private List<Answer> answers = new ArrayList<Answer>();
......
I need to tell how many answers for the...
Hi
I am trying to create a plugin for dotCMS. My plugin stores data in database. i defined hibernate mapping file and put in my plugin folder's conf dir and i have no idea how to hibernate generate models based my mapping definition. I am using hello world plugin's mapping file for mysql
Any help or comment would be highly appreciated
...
Hello,
I have my domain object, Client, I've got a form on my JSP that is pre-populated with its data, I can take in amended values, and persist the object.
Client has an abstract entity called MarketResearch, which is then extended by one of three more concrete sub-classes.
I have a form to pre-populate some MarketResearch data, but ...
Heyy;
I am developing a small swing based application with hibernate in java. And I want fill combobox from database coloumn.How ı can do that ?
And I don't know in where(under initComponents, buttonActionPerformd) ı need to do.
For saving ı'am using jbutton and it's code is here :
private void jButton1ActionPerformed(java.awt.event...
Hello,
Here's my scenario. I save a bunch of Strings containing asian characters in MySQL using Hibernate. These strings are written in varbinary columns. Everything works fine during the saving operation. The DB contains the correct values (sequence of bytes). If I query (again using Hibernate) for the Strings that I saved I get the co...
Hey
I am connecting a MYSQL database through hibernate and i seem to have processes that are not being killed after they are finished in the session. I have called flush and close on each session but when i check the server the last processes are still there with a sleep command. This is a new problem which i am having and was not the ...
Why does my cfc method (when returning JSON format or called via remoting) return all related objects regardless of the lazy setting on the property?
...
I am developing swing based application with hibernate in java . And ı want to make search on database , and listing result...
Before ı used to JDBC and ResultSetTableModel , and my before code is here :
try{
Class.forName("*****************").newInstance();
Connection baglan=(Connection) DriverManager.getConnection("*******...