-->
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.  [ 1 post ] 
Author Message
 Post subject: Question regarding discrimator and where clause
PostPosted: Wed Oct 01, 2008 5:34 pm 
Newbie

Joined: Wed Oct 01, 2008 5:29 pm
Posts: 1
Hi Folks,

I'm wondering if there's a nice way to solve my problem.

I have an abstract BaseEntity that have this inside:

Code:
   @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
   @JoinColumn(name="entity_id")
   @org.hibernate.annotations.Where(clause = "discriminator='Alias'")
   @OrderBy("startDate DESC")
   private List<Discontinued> discontinuedEntries = new ArrayList<Discontinued>(0);



I have a class Alias that extends BaseEntity.

If you look inside the code section, I do a where clause that have discriminator='Alias'

I would like to be able to set that value according to my child class. Is there a nice way to do that, or I have to move this variable declaration inside of my Alias class.

thank!


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

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.