Hello !
I'm reading data from a table( from a MySQL Database) with Hibernate SQL Query.
The thing is, the table contains a colum that is mapped to a char in Hibernate Model, and sometimes this column is empty.
And I suppose this is where my exception comes from.
How can I map a colum of char to my hibernate model without getting this err...
I have an application A with a domain-model which is mapped to a database using Hibernate. I have another application B that uses exactly the same domain-model-classes as A and adds some additional classes.
My goal is to read data from database A in application B and transfer that data into the database of B (to make a copy of it). In ...
What role is Spring taking in Struts + Spring + Hibernate?
...
I'm using hibernate validator framework with Spring. A class implementing the Spring Validator validates objects with Hibernate's ClassValidator. To localize ClassValidator's error messages I need to pass a ResourceBundle into the class' constructor. My ApplicationCountext has a MessageSource bean (ReloadableResourceBundleMessageSource) ...
Usually pagination queries look like this. Is there a better way instead of making two almost equal methods, one of which executing "select *..." and the other one "count *..."?
public List<Cat> findCats(String name, int offset, int limit) {
Query q = session.createQuery("from Cat where name=:name");
q.setString("name", name);...
I need to add a new many-to-many relationship to an existing Hibernate entity.
I do not want to touch the original Hibernate entity bean or its configuration.
What I am adding is a "tagging" feature that can be viewed as an external contribution and not part of the entity's data itself.
I want to have a simple join table with only two c...
I have a table with one field that can point to a foreign key in one of 3 other tables based on what the descriminator value is (Project, TimeKeep, or CostCenter. Usually this is implemented with subclasses, and I am wondering if what I have below will work. Note the subclass name is the same as the parent class and the noteObject prop...
How you fix the following Hibernate error:
What does "Use of the same entity name twice".
...
It appears that our implementation of using Quartz - JDBCJobStore along with Spring, Hibernate and Websphere is throwing unmanaged threads.
I have done some reading and found a tech article from IBM stating that the usage of Quartz with Spring will cause that. They make the suggestion of using CommnonJ to address this issue.
I have ...
In JPA the Entities are nice annotated Plain Old Java Objects. But I have not found a good way to interact with them and the database.
In my current app, my basic design is always to have a sequence based id as primary key so I usually have to look up entities by other properties than PK.
And for each Entity I have a stateless EJB of
...
In my app I have these Hibernate-mapped types (general case):
class RoleRule {
private Role role;
private PermissionAwareEntity entity; // hibernate-mapped entity for which permission is granted
private PermissionType permissionType; // enum
@ManyToOne
@JoinColumn(name = "ROLE_ID")
public Role getRole() {
return role;
...
Hello
We are using Hibernate 3.1 with Spring MVC 2.0. Our problem occurs when data is updated on the database directly (not in the application). We use a Filter to filter a collection of results by whether the orders are opened or closed. If we change an order on the DB to be closed, the filter returns the correct list, however, the ...
I'm trying to serialize objects from a database that have been retrieved with Hibernate, and I'm only interested in the objects' actual data in its entirety (cycles included).
Now I've been working with XStream, which seems powerful. The problem with XStream is that it looks all too blindly on the information. It recognizes Hibernate's ...
We use Spring + Hibernate for a Webapp.
This Webapp will be deployed on two unrelated production sites. These two production sites will use the Webapp to generate and use Person data in parallel.
What I need to do, is to make sure that the Persons generated on these two unrelated production sites all have distinct PKs, so that we can m...
I want to compare the current value of an in-memory Hibernate entity with the value in the database:
HibernateSession sess = HibernateSessionFactory.getSession();
MyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id);
newEntity.setProperty("new value");
MyEntity oldEntity = (MyEntity)sess.load(MyEntity.class, id);
// CODEBLOCK#1 ...
Is it possible to make hibernate do "the right thing" for some value of "right" in this situation?
from ClassA a, ClassB b
where a.prop = b.prop
The thing is that prop is a UserType with different representation in the joined tables. In table A it is represented as an integer and in table B it is represented as a char. So the eq test ...
Hi,
I have a SEAM app with some JPA/Hibernate entities. And I now wonder where to put my query, persistence methods.
The default choice seems to put them in a session bean layer with injected
@PersistenceContext(...) @Inject EntityManager entityManager;
But I think I would rather have the methods on the entities themselves. What ar...
It seems like most examples of JPA/Hibernate entity bean classes I've seen do no explicit synchronization. Yet, it is possible to call getters/setters on those objects in the context of building up a transaction. And it's possible for those methods to be called across multiple threads (although maybe that's unusual and weird).
It se...
I'm taking on the re-architecting of a pair of applications which use Hibernate in one case, and a combination of Hibernate and a Java Content Repository (specifially JackRabbit) in the second.
A key issue in the rearchitecting is to improve performance, so I'm wondering whether there's any value in bringing in a DBA for the design and ...
Hi all,
I'd like to call methods of my DAOs by AJAX. I'm quite new in that so I would like to ask what is the best way to do that. Is it possible to publish my beans as web services and call them with e.g. jQuery? I think it is not possible :) I've also read about Direct Web Remoting but I don't know which way to go...
As I see, there...