I have a small system consisting of a .net client and a java web service.
The .net client inserts an object into the database, and then calls the web service. The web service tries to retrieve this object using hibernate. First time it works fine, but every other time it says that there is no object with the given identifier.
I have ch...
We have an application which has a swing client and java app on the server (jboss.4.2.1.GA) side. We are using ejb3.
In our application at some point we are successfuly creating an invoice and show it to the user but when user wants to chage the invoice we get the following error. After reloading the invoice user can be able to change t...
I have the following structure:
[Class]
public class SuperClass
{
}
[JoinedSubclass]
public class SubClass : SuperClass
{
}
[Class]
public class ContainerClass
{
[ManyToOne]
public SuperClass SomeProperty {get; set;}
}
However, when retrieving an instance of ContainerClass via Hibernate.ISession.Get, it always returns me an ...
I have an existing java webapp that uses Hibernate for it's persistence. I've been told that I have to have to talk to the DB encrypted - so my first thought is to set it up to do the communication via SSL - and went through figured out how to set up Oracle to listen for JDBC over SSL -
http://www.oracle.com/technology/tech/java/sqlj_...
I'm annotating my DAOs and using hibernate3:hbm2ddl to generate the ddls. Is there a way to annotate the tablespace?
...
I have a requirement to create a component which can be used stand-alone or within a larger application. When used stand-alone, it should not require a database, nor any database/ORM related dependencies. When used as as part of a larger app, some of the classes will indeed be persisted to a database via JPA/Hibernate.
I was thinking ...
Consider the following domain model:
Issue
- id
- List<Comment>
Entry
- id
- List<Comment>
Comment
-id
-comment
In my design, I was attempting to create two join tables to manage the associations; issue_comments, and entry_comments. I assumed @OneToMany on Issue & Entry, but how do you map the multiple join tables? Using hibernate ...
Hi,
The problem looks like this:
A Product table. 3 joined-subclasses: DVD, CD, Book.
A Role table (composite id: NAME, ROLE, PRODUCT), and subclasses by discriminator column ROLE: actor, director, artist, author, etc.. which are mapped to Actor, Director, Artist, Author java classes; (pretty usual I guess) ...
A Book has authors, a C...
Hello friends,
I am developing an application using oracle 11g, Java(struts2) and Hibernate.
I have table named mytemp with column mytemp_id which is of type NUMBER(22,0).
In my mytemp.hbm.xml file id is as given below
<id name="mytempId" type="big_decimal">
<column name="MYTEMP_ID" precision="22" scale="0" />
<genera...
Hi!
I have two entities like the following:
@Entity
public class Trip {
@OneToMany(mappedBy = "trip", fetch = FetchType.LAZY)
private Set<Job> jobs = new HashSet<Job>();
}
@Entity
public class Job {
@ManyToOne(fetch = FetchType.LAZY)
private Trip trip;
}
The problem is that the mappedBy relationship behaves diffe...
Hi there!
Here's the code:
Patient patient = factory.createPatient();
Enhancer enhancer = new Enhancer();
enhancer.setSuperclass(patient.getClass());
enhancer.setCallback(new DefaultMethodInterceptor(patient));
patient = (Patient) enhancer.create();
assertThat(patient.getFirstName()).isNotNull();
...
Hi all,
I've got the following named query in Hibernate:
<sql-query name="CreateLogTable">
CREATE TABLE IF NOT EXISTS :tableName (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`url` VARCHAR (750) NOT NULL,
`query` VARCHAR (500),
`ipaddress` VARCHAR (39),
`datetime` DATETIME NOT NULL,
`hits` MEDIUMINT UNSIGN...
I'd like to use Hibernate's Criteria API for precisely what everybody says is probably its most likely use case, applying complex search criteria. Problem is, the table that I want to query against is not composed entirely of primitive values, but partially from other objects, and I need to query against those object's id's.
I found th...
An application deployed on several machines - accesses the same DB Table.
It reads the MIN row and then deletes that row.
When this happens concurrently, we get a -913 error from DB2 signifying deadlock.
Have tried following options already
1. locks on row.
2. re-try mechanism in application code, after the deadlock occurs.
Nothing se...
I am having trouble setting the type of a String, it goes like
public void setTextDesc(String textDesc) {
this.textDesc = textDesc;
}
@Column(name="DESC")
@Lob
public String getTextDesc() {
return textDesc;
}
and it didn't work, I checked the mysql schema and it remains varchar(255), I also tried,
@Column(name="DESC", length="900...
Hi all,
just a simple question about a great problem...
In my web app i use Struts, Spring and Hibernate.
I've a lot of Business (classes that edit the database with Hibernate), many action that interact with Business.
In Spring configuration i've inject SessionFactory in Business and the Business into Actions.
When I call a busines...
I've been doing some Java development, and have learnt my basics. I would like to take my skill to the next level by learning frameworks that are mainstream.
I hear about Spring + Hibernate all the time. Lately, there has been some talk on Java EE with EJB 3 etc. I know there is a lot of war going on, but I'm looking for an answer.
I k...
I'm essentially looking for a "@Ignore" type annotation with which I can stop a particular field from being persisted. How can this be achieved?
...
when my app startup, i get error like below, can anyone elaborate what i missed out? the app running fine when using mysql. do i miss out any extra parameter in config.xml file?
2009-08-17 11:32:12,294 [main] INFO [info.jtrac.config.DataSourceFactoryBean] -
Not using embedded HSQLDB or JNDI datasource, switching on Apache DBCP data sour...
In hibernate as well as simple ORM strategy,i am normally loading all the values for the objects.Is there any way to avoid this.
Due to this my app running slowly..
...