ClassDescriptor.getTable() NULL [message #846662] |
Mon, 16 April 2012 14:53 |
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 14:57] Report message to a moderator
|
|
|
|
|
|
|
Re: ClassDescriptor.getTable() NULL [message #847392 is a reply to message #847375] |
Tue, 17 April 2012 08:58 |
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 12:01] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04132 seconds