nHibernate Share References?
I'm getting a "Found shared references to a collection" exception when saving an object. Does anyone know what this means? ...
I'm getting a "Found shared references to a collection" exception when saving an object. Does anyone know what this means? ...
Is there an easy or straightforward way in Java to output the results of a DB Query to a file (either csv, tab, etc). Perhaps even in Hibernate? I know that a query results can be dumped to a flat file on the DB Server. I am looking for a way that an application can run a query and get those results into a file. I realize one option ...
I'm trying to do query result pagination with hibernate and displaytag, and Hibernate DetachedCriteria objects are doing their best to stand in the way. Let me explain... The easiest way to do pagination with displaytag seems to be implementing the PaginatedList interface that has, among others, the following methods: /* Gets the total...
I am using Hibernate 3.x, MySQL 4.1.20 with Java 1.6. I am mapping a Hibernate Timestamp to a MySQL TIMESTAMP. So far so good. The problem is that MySQL stores the TIMESTAMP in seconds and discards the milliseconds and I now need millisecond precision. I figure I can use a BIGINT instead of TIMESTAMP in my table and convert the types i...
In my domain model I have an abstract class CommunicationChannelSpecification, which has child classes like FTPChannelSpecification, EMailChannelSpecification and WebserviceChannelSpecification. Now I want to create an HQL query which contains a where clause that narrows down the result to certain types of channel specifications. E.g. (i...
We're using Hibernate in our Spring web app to do reads, as well as DML with a DB2 database. This problem only occurs during an update. If we blow away the lock on the DB2 side, it appears that any updates are not syncing with the database (even though I do session.flush() and session.clear() after an update is performed). This really...
I'm trying to setup Spring using Hibernate and JPA, but when trying to persist an object, nothing seems to be added to the database. Am using the following: <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="url" value="${jdbc.url}"/> <property name="driverClassName" value="${jdbc.driverClass...
I am starting a job with a mid size company working mostly on writing custom apps that interact with their ERP system. This is my first time doing this sort of work, so the ERP concept is new to me and I am learning it piece meal. I have only written two apps so far and have learned the database model as I went and only as much as I n...
I recently started working on a large complex application, and I've just been assigned a bug due to this error: ORA-04091: table SCMA.TBL1 is mutating, trigger/function may not see it ORA-06512: at "SCMA.TRG_T1_TBL1_COL1", line 4 ORA-04088: error during execution of trigger 'SCMA.TRG_T1_TBL1_COL1' The trigger in question looks like ...
@Column(name="DateOfBirth") private Date dateOfBirth; I specifically need the above code to create a column named "DateOfBirth," instead Hibernate gives me a column named date_of_birth. How can I change this? Is there a web.xml property? I came across DefaultNamingStrategy and ImprovedNamingStrategy, but not sure how to specify one ...
Im searching for the best way to mantain combo box values within a Mysql Database accessed by Hibernate objects. Currently we have the following table: CREATE TABLE COMBO_VALUES( KEY VARCHAR(5) NOT NULL, COMBO_TYPE VARCHAR(20) NOT NULL, VALUE VARCHAR(100) NOT NULL PRIMARY KEY(KEY,COMBO_TYPE) ); INSERT INTO COMBO_VALUES VALU...
I am developing an Eclipse plug-in that fits a client-server model. Its a commercial project so we cannot re-distribute the JDBC drivers for the various databases we support with the plug-in. So I developed a preference page to allow the user locate the jars and have a simple discovery mechanism that iterates through the classes in the ...
I would like to map a many-to-many in Hibernate using a link table. I have two classes, Parent and Child class, for example: public class Parent{ private List<Child> _children; //...getters and setters } I use a link table (link_table) with three columns link_id, parent_id, and child_id. The database is SQL server and id types are u...
I'm building a database web application using Java and Hibernate's JPA implementation. The application tracks objects. It also has to batch import objects from a legacy source. For example, let's say we're tracking people. The database has tables called Person and Address. There are corresponding JPA entity and DAO classes. On top of t...
To the best of my knowledge, creating a dynamic Java proxy requires that one have an interface to work against for the proxy. Yet, Hibernate seems to manage its dynamic proxy generation without requiring that one write interfaces for entity classes. How does it do this? The only clue from the Hibernate documentation refers to the fact th...
Hi, I'm storing a simple java.util.date in an Oracle XE database via hibernate. When testing with JUnit if I can retrieve the correct value, I get an error like this: junit.framework.AssertionFailedError: expected:<Sun Dec 28 11:20:27 CET 2008> but was:<2008-12-28 11:20:27.0> The value is stored in an Oracle Date column (which...
It's quite some time that I'm trying to figure out this problem and from googling around many people have similar problems. I'm trying to model a User in a Social Network, using Hibernate, and what is more basic to a social network than to map a friendship relation? Every user in the system should have a list of it's friends and I thoug...
I have the domain classes: class Child { static hasMany = [ toys : Toy ] String name Set toys } class Toy { static belongsTo = [ owner : Child ] String name } In my JSP I reference a child by: child = Child.findByName("Joe") or child = Child.findById(123) But when I attempt to access its fields: child.getTo...
I have the domain classes: class Person { static hasMany = [ items: Item ] static fetchMode = [ items: 'eager' ] String name Set items } class Item { static belongsTo = [ owner: Person ] String name } If I leave static fetchMode = [ items: 'eager' ] in place, then calling getItems() only returns about 10% of t...
What API or tools can I use to query the capabilities of the system and choose the most appropriate on for putting the PC to Sleep, Hibernate or shutdown mode? Thanks for any pointers. ...