Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » ClassDescriptor.getTable() NULL
ClassDescriptor.getTable() NULL [message #846662] Mon, 16 April 2012 10:53 Go to next message
Gaurav Malhotra is currently offline Gaurav Malhotra
Messages: 6
Registered: April 2012
Junior Member
Hi All,
Below is strucuturefor single table inheritance

@Table(name = "REL_PROVIDERS")
@DiscriminatorValue("INPR")
@Cacheable(false) // If not leads to recursion in TLG
public class IndividualProviderDomain extends IndividualProviderPersistable

@MappedSuperclass
public abstract class IndividualProviderPersistable extends ProviderDomain implements IndividualProvider, DynamicLanguageAware

@Entity
@Configurable
@Table(name = "REL_PROVIDERS")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "SUBTYPE", discriminatorType = DiscriminatorType.STRING, length = 20)
@Cacheable(false) // If not leads to recursion in TLG
public class ProviderDomain extends ProviderPersistable

@MappedSuperclass
public abstract class ProviderPersistable implements Provider, DynamicFieldDynamicLanguageAware

In session customizing phase when I grab a class descriptor on IndividualProviderDomain and call getTableName() on it I get NULL.

I debugged the EntityProcessor.processTableAndInheritance() and found that

if (hasInheritance() || ! rootDescriptor.usesSingleTableInheritanceStrategy()) {
processTable();
}

is never hit
hasInteritance() >>> false as I have not put @Inheritance on IndividualProviderDomain (Is it required????) and
rootDescriptor (ProviderDomain).usesSingleTableInheritanceStrategy() == true

so the processTable is never hit and no meta data for table.

Also I have observed if I have put the IndividuaProvdier on GridCache, TLG code goes in to recursion, which composing entity, I am not sure, whether these as related issue.

Looking for suggestions

Thanks,
Gaurav Malhotra
Oracle NL

[Updated on: Mon, 16 April 2012 10:57]

Report message to a moderator

Re: ClassDescriptor.getTable() NULL [message #846663 is a reply to message #846662] Mon, 16 April 2012 10:56 Go to previous messageGo to next message
Gaurav Malhotra is currently offline Gaurav Malhotra
Messages: 6
Registered: April 2012
Junior Member
I am using eclipselink 2.3.2.
Re: ClassDescriptor.getTable() NULL [message #846675 is a reply to message #846663] Mon, 16 April 2012 11:59 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

A @MappedSuperclass cannot extend an @Entity, only the other way around.
Change IndividualProviderPersistable to be an @Entity.


James : Wiki : Book : Blog : Twitter
Re: ClassDescriptor.getTable() NULL [message #846784 is a reply to message #846675] Mon, 16 April 2012 14:52 Go to previous messageGo to next message
Gaurav Malhotra is currently offline Gaurav Malhotra
Messages: 6
Registered: April 2012
Junior Member
Everthing worked fine in the deployed env/integration tests... search/insert/update/delete

I was wondering what is reason behind this? @MappedSupperClass cannot extend an entity?

[Updated on: Tue, 17 April 2012 04:03]

Report message to a moderator

Re: ClassDescriptor.getTable() NULL [message #847375 is a reply to message #846784] Tue, 17 April 2012 04:38 Go to previous messageGo to next message
Gaurav Malhotra is currently offline Gaurav Malhotra
Messages: 6
Registered: April 2012
Junior Member
Adding @Entity on the IndividualProviderPersistable has the same affect

@Entity
public abstract class IndividualProviderPersistable extends ProviderDomain implements IndividualProvider, DynamicLanguageAware
Re: ClassDescriptor.getTable() NULL [message #847392 is a reply to message #847375] Tue, 17 April 2012 04:58 Go to previous message
Gaurav Malhotra is currently offline Gaurav Malhotra
Messages: 6
Registered: April 2012
Junior Member
Interestingly adding adding @Inheritance made it work

@Entity
@Configurable
@Table(name = "REL_PROVIDERS")
@DiscriminatorValue("INPR")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class IndividualProviderDomain extends IndividualProviderPersistable {

@Autowired
private transient GenericCoherencePofWriter genericCoherencePofWriter;
@Autowired
private transient GenericCoherencePofReader genericCoherencePofReader;

.... ..... .....

Seems to me the following check in EntityAccessor is not covering all the scenarios

if (hasInheritance() || ! rootDescriptor.usesSingleTableInheritanceStrategy()) {
processTable();
}

[Updated on: Tue, 17 April 2012 08:01]

Report message to a moderator

Previous Topic:Default strategy for PostgreSQL
Next Topic:serialUID mismatch on remote EJB call
Goto Forum:
  


Current Time: Wed Aug 20 12:36:14 EDT 2014

Powered by FUDForum. Page generated in 0.02333 seconds