I had an object a of type A retieved from hibernate
Set. I did some modification to the a. During this
process, its hashCode changed. Then I would like to
remove it from the Set. I removed it like this
net.sf.hibernate.collection.Set.remove(A).
The hibernate Set can not find and remove the Object
Hi, all
Caused by: net.sf.hibernate.HibernateException: Flush
during cascade is dangerous - this might occur if an
object was deleted and then re-saved by cascade
Any hint what might cause this exception?
Thanks
jason
__
Do you Yahoo!?
Yahoo! SiteBuilder - Free
--- [EMAIL PROTECTED] wrote:
>
> You need to learn about the mysteries of the
> unsaved-value
> attribute :)
>
> Hibernate looks at the id value to determine if an
> object
> discovered by cascade is "new" or not. So, if you
> have an
> object with a Long identifier, set
> unsaved-value="null".
--- [EMAIL PROTECTED] wrote:
>
> >Here the children set in the Parent object is
> >readonly. Does it mean any modification to any
> "Child
> >element" in the Children set will not be persisted
> to
> >database( an violation of usual persistence by
> >reachability)? In
>
> No, it is nothing to do
Use the example from hibernate-reference manual:
Here the children set in the Parent object is
readonly. Does it mean any modification to any "Child
element" in the Children set will not be persisted to
database( an violation of usual persistence by
reachability
I use the Java code instead of Hibernate to keep the
parent-child relationship.
For example suppose I have such a relationship
Parent-->Level1-->Level2
The class implementation could be like this
public class parent {
public void setChild(Level1 child){
if (child.getParent()==null)
child.set
I have a collection of thing. I do not care whether
there is duplication or not. I can use Set to prohibit
duplication. I can also use list and bag.
If I use Set rather than list/bag, I think the
performance is not so good as it is for list/bag,
since set has to limit duplication.
I noticed that
suppose I have two table
create table A (
id integer primary key
);
create table B (
id integer primary key,
idA integer not null,
constraint FK_B_TO_A foreign key (idA) references A
(id) on delete cascade
);
Here suppose A to B is a one-to-many asso
crete example I encoutered in my application.
Thanks
jason
>
>
>
>
>
> jiesheng zhang
>
>
Hi, guys
I am currently designing a Java project. I'd like to
use a Object relational mapping tool to manage the
persistnece layer. My friend suggests hibernate for
me. Other people also warns me about the capability
of Object relation mapping solution. This makes me
worry about the hibernate capa
Clarify my question here:
suppose I have two table
create table A (
id integer primary key
);
create table B (
id integer primary key,
idA integer not null,
constraint FK_B_TO_A foreign key (idA) references A
(id) on delete cascade
);
Here suppose
Suppose we have a interface A, and an implemenation
class A_Impl.
In this case, there is no discriminator column and
discrimator value. Can I use
...
to map this?
Or I have to use
http://mailplus.yahoo.com
---
This SF.NET email is sp
Can I implement this as this?
Leave Address as a interface.
Class ToAddress--- mapped to address with type='t'
class CCAddress---mapped to Address with type='c'
Then in Class has two sets
toaddr mapped to a list of ToAddress
ccaddrmapped to a list of CCAddress
Althought I did not try, but
I have one usage scenario as below:
The classes could be like this.
public class Person {
...
List Addresses; //A list of Address objects.
}
public class Address {
...
List types; //A list of AddressType object
}
public class AddressType {
long typenum;
>
> table="child">
> class="org.appfuse.persistence.ChildId"
> unsaved-value="none">
> length="22" name="parentId"
> type="long"/>
Try this:
and remove the the below.
> length="22" name="recordNum"
> type="long"/>
>
> nam
--- Viktor Szathmary <[EMAIL PROTECTED]> wrote:
> hi,
>
> On Mon, 3 Feb 2003 09:32:39 +1100,
> [EMAIL PROTECTED] said:
> >
> > Are there proxies involved?
> >
>
> hopefully not :) it seems that there's actually two
> calls to
> nestedChild.setParent() on the same nestedChild
> instance - the s
import java.util.Random;
public class A
{
// the object id, unsaved=0;
private long id=0;
private String value;
public boolean equals(Object obj)
{
if (obj==this)
{
/*
My problem is that I know one object is type A, but
when I try to cast to A, I got a ClassCastException.
I have four classes in my cases: ContentDB,
ServerFileSysNode, InnerNode, and SharedFileSysNode.
ServerFileSysNode(abstract)
InnerNode (concrete subclass of ServerFileSysNode,
may have
It definitely works. I have many such methods like
what you mentioned.
Post your method implementation and exception here.
Let me have a look.
jason
--- Warner Onstine <[EMAIL PROTECTED]> wrote:
> Got this working!
>
> Now I have another question with regards to
> collections in general.
>
>
My system is a prototype system. There is only one
test user at any time.
For this user, there is about 500-600 objects loaded
in the Hibernate session
at maximal. Very often, my application needs to
change only one field
in one object and commit
the transaction. My code is like this
Tranactio
in the session.
Obtaining database connection should not be a problem
since the database connection is pooled at Tomcat
layer.
How do you think of this idea?
Thanks
jason
> jiesheng zhang wrote:
>
> >First I have a source class like this.
> >public class Source
> &
First I have a source class like this.
public class Source
{
Transaction tx;
List pendingRemovedItems;
public void beginTransaction()
{
// here I use ThreadLocal pattern.
tx= ThreadState.getSession().beginTransaction();
}
Hi,
I once suspect that hibernate take too much time in
doing dirty check during session flush. However Gavin
king and other hibernate-user disagreed with me.
I did a simple performance testing to verify the dirty
check performance.
My conslusion is that the performance is not so good
if there a
23 matches
Mail list logo