-->
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.  [ 5 posts ] 
Author Message
 Post subject: Override fields to transient
PostPosted: Tue Dec 04, 2007 3:48 pm 
Newbie

Joined: Tue Dec 04, 2007 2:48 pm
Posts: 6
Hi,

I would like to know if it is possible to override a embedded field (and also a parent class field) to turn it transient. The use case is:

Code:
@MappedSuperclass
@Embeddable
public class Person {
  private String name;
  private Date dateOfBirth;
  ...
  @Column(name = "NAME")
  public String getName() {
    return name;
  }
  @Column(name = "BIRTH")
  public Date getDateOfBirth() {
    return dateOfBirth;
  }
  ...
}

@Entity
public class Actor {
  private Person person;
  ...
  @Embedded
  // I need to turn dateOfBirth transient
  public Person getPerson() {
    return person;
  }
  ...
}

@Entity
@Table("DIRECTOR")
// I need to turn dateOfBirth transient
public class Director extends Person {
  ...
}


Tnx.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 05, 2007 11:25 am 
Newbie

Joined: Tue Dec 04, 2007 2:48 pm
Posts: 6
I looked every annotation and @AttributeOverride can only have name and column properties, and the column property can oly receive @Column nd this annotation does not have a transient option. Can I add a RFE at Hibernate Jira?

TY


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 09, 2008 1:21 pm 
Beginner
Beginner

Joined: Fri Sep 12, 2008 10:55 am
Posts: 33
Did you ever figure out how to do this?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2008 4:00 pm 
Newbie

Joined: Tue Nov 18, 2008 1:03 pm
Posts: 1
Location: AZ
I'm basically running into the same problem. What I'm having to do is just remove the @MappedSuperclass annotation from the super class. Unfortunately this means I have to explicitly override in my derived class any properties I do want mapped. I tried really hard to find a better way, but I don't see it. If someone does have a better way please post!

I really think there needs to be a way to override inherited mappings to make them transient and such.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2009 5:13 pm 
Newbie

Joined: Thu Feb 05, 2009 5:08 pm
Posts: 2
I would really like to know the outcome of this problem. If there is anyone who solved this problem, please let us know. Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.