Jonathan Wood commented on Bug OGM-233

A brief update on progress made:

I was able to persist the correct table name by modifying org.hibernate.ogm.persister.OgmEntityPersister's constructor:

tableName = persistentClass.getTable().getQualifiedName(
factory.getDialect(),
factory.getSettings().getDefaultCatalogName(),
factory.getSettings().getDefaultSchemaName()
);

replaced with:

tableName = persistentClass.getDiscriminatorValue();

I understand that this is not a solution, but was an attempt to isolate the problem. Another approach tested was the addition of a (invalid by OGM docs) modification of the Base class:

@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public class Hero {

This change also produces the correct persisted table without modifying the core OGM code. This kinda makes sense since orm is being asked to derive the table name and if I recall correctly JPA defaults to SINGLE_TABLE in the absence of @Inheritance.

While these approaches seem to solve the table name issue on persistence, re-hydration is still problematic. I'm going to move on to that issue.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira