Hi all,
I recently switched from Apache DBCP connection pooling to C3P0 and have gone through my logs to see that there are connection timeout issues. I haven't had this in the past with DBCP and Tomcat, so I'm wondering if it is a configuration issue or driver issue.
Whenever I load a page after the server has been idle for a while, ...
Hi,
I'm trying to insert an HTML blob into our sql-server2005 database. i've been using the data-type [text] for the field the blob will eventually live in. i've also put a '@Lob' annotation on the field in the domain model. The problem comes in when the HTML blob I'm attempting to store is larger than 65536 characters. Its seems that...
Need some help on understanding how to do this; I'm going to be running recursive 'find' on a file system and I want to keep the information in a single DB table - with a self-referencing hierarchial structure:
This is my DB Table structure I want to populate.
DirObject Table:
id int NOT NULL,
name varchar(255) NOT NULL,
par...
I've observed the strange fact (based on the questions in the hibernate tag) that people are still actively using xml files instead of annotations to specify their ORM (Hibernate/JPA) mappings.
There are a few cases, where this is necessary:
you are using classes that are provided, and you want to map them.
you are writing an API, who...
We started with a fairly standard relationship between a Project entity and a ProjectStatus entity via a join table. The class declarations (with annotations) look like this.
@Entity
@Table(name="PROJECT")
public class Project {
@Id
@Column(name = "PROJECT_ID")
private Long id;
@ManyToOne(fetch=FetchType.EAGER, cascad...
hi all, I have problem in creating tinyint field in MySQL database using Hibernate.
I used to write the Entity class like this
@Entity
@Table(name="tablename")
public class MyEntity {
private int id;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="id")
public int getId() {
return id;
}
public void setId(int id) {
...
Is there a working JPA 2 implementation for JBoss server? Or maybe there is some additional extension that provides JPA 2's criteria api equivalent?
...
My current set up is a single dedicated server with Java, hibernate app running on tomcat, apache http server, MYSQL.
I need to get a second server to share the load, but using the same database from the first server.
The backend processing(excluding db transaction) is time consuming, hence the second server for backend processing)....
Hi everyone,
I'm working on a JPA (Hibernate implementation of), Spring and Stripes web app. I have a number of JPA entities that have the following fields in common for both audit and query purposes:
createdBy - the user ID of the person who created the entity.
createdOn - the date the entity was created
updatedBy - the user ID of the...
I got a table with a PK and a value "country", all my labels are definied in another table which has composite-ids.
Does anyone has an example for me how I can map my country value to the correct label in the other table?
mappings are bound on PK, if I'm not wrong.
<class name="hibernate.P1" table="P1">
<id name="id" type="int...
Is any way to add implicit restriction to entity in HQL? For example when we query list with hql "from Client" we need select only thouse clients, that have some particular system id. System id itself depends on user session. So we need this query to be actually converted to "from Client where systemId=:systemId" although we didn't speci...
I want a unidirectional one-to-one relationship between objects of 3 java classes: Person to Heart, and Person to Liver. I want the objects to share the same PK i.e. every person has a corresponding heart and liver, where person.person_id = heart.heart_id = liver.liver_id. I do not want to merge the 3 tables into 1 because each has loads...
Hi - I am trying to reverse engineer pojos (using hibernate tools plugin v3.2.4x in eclipse 3.4.2) from a database that I have created in Postgres but my tables are being ignored. It works if I specify 'public' as the value for the 'hibernate.default_schema' property in my hibernate.cfg.xml file but if I try to specify a different schema...
Hi,
I have a Hibernate class which has a reasonably complicated implementation of equals(). Is it possible to write a query that returns all instances of this class that have at least one other equal object, where equality is defined by the implementation of equals()?
Update
Evidently this is not possible. As an alternative, is it poss...
What is the best practice for this problem? Is there any batching features built-in?
Sample code:
using (ITransaction transaction = _session.BeginTransaction())
{
_session.Delete("FROM myObject o WHERE o.Id = IN(1,2,...99999)");
transaction.Commit();
}
Thanks in advance.
...
Hi all,
I am new to hibernate and trying integrate hibernate with an existing spring based application.
I configured session factory and transaction manager, transaction proxy template.
I am also using Quartz scheduler in this application.
When I run the application, I am getting the following exception.
ERROR au.com.michaelpage.cts...
Hello everyone!
Is it possible (and if yes, is it advisable) to do queries of Hibernate-mapped data without using SQL-strings, but some OOP way instead?
...
Most Hibernate tutorials use Maven for handling the build, but I'm looking for a basic configuration using Ant instead. I've reviewed this some:
https://www.hibernate.org/hib_docs/tools/reference/en/html/ant.html
However, it seems like it covers way more in an introductory tutorial than I need. I really want to get started w/ some simp...
I have a query that joins 5 tables.
Then I fill my hand-made object with the column values that I need.
What are solutions here that are wide-common to solve that problem using specific tools ? are there such tools?
I'm only beginning to learn Hibernate, so my question would be: is Hibernate the right decision for this problem?
Hibern...
I've been trying to make GORM throw an optimistic locking error in an integration test. It has been said before that it is not possible to test for concurrent update errors without resorting to multiple threads, but even so I find the behaviour of my test case surprising:
void testOptimisticLocking() {
new Widget(foo:"bar").save(flus...