-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Automatic (re)load of an entity used as DiscriminatorColumn
PostPosted: Wed Aug 15, 2007 10:01 am 
Newbie

Joined: Tue May 16, 2006 12:49 pm
Posts: 8
Hibernate version: 3.2.1.GA

Mapping documents:
Code:
@Entity
@DiscriminatorColumn(name = "ID_TXN_TYPE", discriminatorType = DiscriminatorType.INTEGER)
public abstract class Transaction {

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "ID_TXN_TYPE", insertable = false, updatable = false)
    private Type type;

  //...

}


@Entity
@DiscriminatorValue(value = "-1")
public class JUnitTx extends Transaction {

}


Hi!

I'm having a discriminator column which is used to define a many-to-one relation (see Transaction class) in parallel. Now i have some conrete classes (e.g. JUnitTx) with distinct discriminator columns and so far, everything works fine.
Point is, if I want to get the Type, it is null, even after I inserted the entity, it is null. I must flush, evict&load or refresh the entity to have the value available.
Is there anyway to let Hibernate automatically fetch the entity associated with the discriminator column?

Thanks,
Sebastian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 24, 2007 1:59 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Try @Generated (check the ref doc), but I think it will not work

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.