1

First of all I wanna thank the administrator of this forum and all people who participate in it, that’s my first question that I post, So let’s take this example of mapping with hibernate,

@Entity
@Inheritance
@DiscriminatorColumn(name="PROJ_TYPE")
@Table(name="PROJECT")
public abstract class Project {
  @Id
  private long id;
  ...
}
@Entity
@DiscriminatorValue("L")
public class LargeProject extends Project {
  private BigDecimal budget;
}
@Entity
@DiscriminatorValue("S")
public class SmallProject extends Project {
}

So I have one table with discriminator value, I make a function that return a Project from the database with Hql and I wanna know how can I know the discriminator value of this object. Thanks in advance.

user1703945
  • 79
  • 2
  • 8
  • 1
    Welcome to Stack Overflow! We encourage you to [research your questions](http://stackoverflow.com/questions/how-to-ask). If you've [tried something already](http://whathaveyoutried.com/), please add it to the question - if not, research and attempt your question first, and then come back. –  Sep 28 '12 at 07:16
  • 1
    This topic can help you http://stackoverflow.com/questions/5584038/java-hibernate-selecting-the-discriminator-column-in-polymorphic-hql-query – Alex Sep 28 '12 at 13:50

0 Answers0