Hello.
Hibernate version:hibernate-3.2
Mapping documents: <class name="bus.Topic" table="perfomer"> <id name="perfomerId" column="perfomerid" unsaved-value="-1"> <generator class="identity"/> </id> <many-to-one name="parent" class="bus.Topic" cascade="none" column="perfomerpid" not-null="true"/> <set name="childrenInternal" inverse="true" cascade="all"> <key column="perfomerpid"/> <one-to-many class="bus.Topic"/> </set> <set name="albumsInternal" inverse="true" cascade="all"> <key column="perfomerid"/> <one-to-many class="bus.Album"/> </set> <property name="pefName" column="pname" type="string"/> <property name="desc" column="description" type="string"/> </class>
Name and version of the database you are using:RostgreSQL
The SQL of a table : CREATE TABLE perfomer ( perfomerid bigserial NOT NULL, perfomerpid integer, pname character varying(50), description text, CONSTRAINT pk3 PRIMARY KEY (perfomerid), CONSTRAINT refperfomer20 FOREIGN KEY (perfomerpid) REFERENCES perfomer (perfomerid) MATCH SIMPLE )
By now the current decision works like a cash of database, i can get through the childrenInternal to any child..and to the child of child..but i don't need it, because i got all problems concerned with a cash
(add,update,delete(if i decide to use only an instance of Topic->minimum directs to database)) , and it takes a lot of time to get data from database.
I need in childrenInternal only one level depth.
Instead of this, hibernate loads all data from database in an instance of class Topic.
Have some ideas?
Thnk!
|