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: Transient methods in superclass in Joined subclass strategy
PostPosted: Tue Feb 03, 2009 2:42 pm 
Newbie

Joined: Mon Feb 02, 2009 12:41 pm
Posts: 5
We are using Joined subclass strategy using @Inheritance(strategy=InheritanceType.JOINED) as below.

@entity
@Inheritance(strategy=InheritanceType.JOINED)
class A
{
//some general properties

private String detail;

@transient
public String getDetail()
{
return detail;
}

@transient
public void setDetail(String detail)
{

this.detail = detail;

}

}


@entity
class B extends A

{

//some specific properties


@Column(name = "Detail")
public String getDetail()
{
super.getdetail();
}


public void setDetail(String detail)
{

super.setDetail(detail);

}

}

Similar there are few more classes that extend A.

We are using getdetail and setdetail transient methods in superclass as shown above to access "details" since we need to access the details using class A.
Is this approach correct from hibernate point of view to have transient methods as shown above in the super class? Please suggest if there is any alternate approach?

Is there any other approach that suites the best for this kind of relationship between tables?

One more thing, is joined subclasses strategy has any performance problems?


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.