I have a mapping (only important parts):
<class name="xyz.Role" table="ROLE" lazy="true">
<id name="id" type="java.lang.Integer">
<column name="ROLE_ID"/>
<generator class="increment"/>
</id>
<set name="assignments" lazy="true" table="PERSON_ROLE" cascade="delete"
inverse="true">
<key column="ROLE_ID" />
<many-to...
I've run into a variety of the 1-n selects problem described here (stack overflow).
I have a Person object with a few OneToOne associations:
Person {
@Version
public Long getOptLock();
@OneToOne(fetch=FetchType.LAZY)
public PersonDetails getDetails();
@OneToOne(mappedBy = "person", fetch=FetchType.LAZY)
public LoginFailure...
I have the following two table (which are tied in with Spring security - but the issue I believe is with Hibernate):
Table user
Table authority
The user table is tied (through Hibernate) to a domain object in my application: class User, which has the following attributes (and corresponding getters and setters), which correspond to col...
My web app is using GWT 2.0.2, GXT 2.1.1, Hibernate 3.5-CR1, Javassist 3.11.0 and Gilead 1.3.1 (latest from SVN).
My app was running just fine with GWT 1.7.1 + Gilead 1.2.
I want to take advantage of some of the features of GWT 2.0, and figured I'd upgrade to the latest Gilead in the process. I pointed to the new gwt.xml file in Gil...
I'm using Hibernate with OpenSessionInViewInterceptor so that a single Hibernate session will be used for the entire HTTP request (or so I wish). The problem is that Spring-configured transaction boundaries are causing a new session to be created, so I'm running into the following problem (pseudocode):
Start in method marked @Transacti...
How best to use hibernate in a simple scenario (questions at end of the post)
Lets say I have this Data Model in code:
class UserGroup
{
int id;
String name;
}
class User
{
int id;
String userName;
}
For the User and UserGroup classes, the underyling database table will look exactly as defined by the classes above.
Now, a ...
I`m doing pagination, 2nd level cache is set up. Through hibernate+criteria it works fine, but through jpa
it works much more slower.
final String hql = "from Employee e "
+ "left join fetch e.positionedEmployees as p "
+ "left join fetch p.address as a "
+ "left join fetch p.comp...
Supposing I have a Person class that is persisted/loaded via hibernate:
class
{
int PersonId;
String Name;
}
PersonId is an "autonumber" that is generated by hibernate when saving the Person.
Now lets say I made a bunch of Person's in a test database that I now want to copy over to the Production database.But, in Production database,...
I'm working on an AJAX application using GWT, Spring and Hibernate. I'm keeping some configuration data on the client side, which is almost never changed, but when it is changed, I have to notify all clients about the changes via a data change event using GWTEventService.
All of this is already working, but I noticed a problem concernin...
I have following mapping for my Category objects:
@Entity
public class Category extends CrawlableEntity implements Identifiable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Expose
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
private Category parent;
@OneToMany(mappedBy = "parent", casc...
Hello,
I would like to override a constraint in hibernate validator. Here is my base class:
@Entity
@Table(name = "Value")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "valueType", discriminatorType = DiscriminatorType.STRING)
public abstract class Value extends CommonTable
{
private String ...
I have
A MySQL database currently in production use for a CakePHP application
A Java SE application accessing the same database via Hibernate, currently in development.
I'm using the Netbeans "automigrate" feature to create the POJO classes and XML files (do I really need the XML files when using annotations?). As the schema is quite...
I am trying to convert my clob object to string to display that on my JSTL page for that I am writting the following code
public String convertClobToString(Clob clob){
String toRet="";
if(clob!=null)
{
try
{
long length=clob.length();
toRet=clob.getSubString(1, (int)length);
...
Hi all,
when updating an entity A, NHibernate also send an SQL update command for some other entity B. A and B are not related. Just before saving entity A, the parent of entity B is loaded via a SQLQuery. Then, when accessed, B is lazy loaded (part of a collection).
If I save entity A an update statement for entity B is generated as we...
Hello All,
I am getting the following exception when running my application in JBoss.
**
Exceptions
**
2010-02-17 15:10:43,435 INFO [STDOUT]
(main) ERROR [2010-10-17 03:10] [main]
(HibernateUtil.java:22) - Hibernate
exceptionCould not parse
configuration:
.\WEB-INF\hibernate.cfg.xml 2010-02-17
15:10:43,435 ERROR
...
[Cross-Posting from ServerFault]
I am in a development environment, and our test Oracle 9i server has been misbehaving for a few days now. What happens is that we have our JDBC connections disconnecting after a few successful connections.
We got this box set up by our IT department and handed over to. It is 'our problem', so options li...
Using jsf 1.2, hibernate, richfaces 3.3.0GA and facelets.
I have this code in my backing bean:
public List<Rater> getFreeRaters(){
GP myGP = (GP) user;
update(myGP.getContract());
ArrayList<Rater> raters = new ArrayList<Rater>(myGP.getContract().getRaters());
ArrayList<Rater> selectedRaters = this.getSelectedRaters();
...
I have a collection of integration tests that have been generated by Spring Roo for my domain objects (and DAO ITDs).
They appear to be fixed to use the "production" applicationContext.xml, which reads the database.properties and connects to the MySQL database schema I have set up for experimenting with the project:
privileged aspect A...
The following code tries to insert an Item object to the db, using Spring+Hibernate. The Item has an Integer id field as primary key, as well as a name column which is subject to a unique constraint (simplified example).
I know that the item's id is null (the item is transient) however the insert may still fail due to the unique constrai...
Hi,
after a child collection with one item in it gets lazy loaded when performing an SQL select on the parent, an update statement is executed for this child afterwards - without explicitly calling update.
Parent mapping:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="ParentEntity"
assembly="ParentEntity">
...