After some further reseach I found out that the used types do not matter. My 
work-a-round now is to put the properties on the parent-object and hide them 
except on the subclasses intended.



Are there any known limits that I miss?

Or can columns only be added to empty tables or ...? 



(function(){(window.hostMIF = 
parent.document.getElementById("ext-gen605").ownerCt)._windowContext={eval:function(s){return
 new Function("return ("+s+")")();}};})()

Hi Johan,

I can only tell you how I do it:

On the subclass:
@javax.jdo.annotations.PersistenceCapable
@javax.jdo.annotations.Inheritance(
     strategy = InheritanceStrategy.SUPERCLASS_TABLE)

On the superclass:
@javax.jdo.annotations.PersistenceCapable(
    identityType = IdentityType.DATASTORE)
@javax.jdo.annotations.Inheritance(
    strategy = InheritanceStrategy.NEW_TABLE)
@javax.jdo.annotations.Discriminator(
    strategy = DiscriminatorStrategy.CLASS_NAME,
    column = "discriminator")
@javax.jdo.annotations.DatastoreIdentity(
    strategy = IdGeneratorStrategy.IDENTITY,
    column = "id")

And on the LocalDate properties of the subclass:
@Persistent
private LocalDate paymentDate;

@Column(allowsNull = "true")
public LocalDate getPaymentDate() {
    return paymentDate;
}


HTH


On 18 February 2015 at 14:28,   wrote:
> Hi,
>
>
>
> I encounter a problem with using JDO inheritance strategy="superclass-table".
>
> When trying to create an instance for the first time (Type LocalDate) my 
> application freezes.
>
> Last output below.
>
>
>
> Anybody encountered this before?
>
>
>
> I have tested with MySQL (then it hangs as well with creating fixtures as 
> with creating instance manually)
>
> and HSQLDB in-memory (then it hangs only with fixtures, not when creating 
> manually)
>
>
>
> gtrz Johan
>
>
>
>
>         14:20:45,798  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Table ProfileElement will manage the persistence of the fields for 
> class info.matchingservice.dom.Profile.ProfileElementTimePeriod (inheritance 
> strategy="superclass-table")
>
>         14:20:45,798  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Column "ProfileElement.endDate" added to internal representation of 
> table.
>
>         14:20:45,798  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Field 
> [info.matchingservice.dom.Profile.ProfileElementTimePeriod.endDate] -> 
> Column(s) [ProfileElement.endDate] using mapping of type 
> "org.datanucleus.store.rdbms.mapping.JodaLocalDateMapping" 
> (org.datanucleus.store.rdbms.mapping.datastore.DateRDBMSMapping)
>
>         14:20:45,798  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Column "ProfileElement.startDate" added to internal representation of 
> table.
>
>         14:20:45,798  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Field 
> [info.matchingservice.dom.Profile.ProfileElementTimePeriod.startDate] -> 
> Column(s) [ProfileElement.startDate] using mapping of type 
> "org.datanucleus.store.rdbms.mapping.JodaLocalDateMapping" 
> (org.datanucleus.store.rdbms.mapping.datastore.DateRDBMSMapping)
>
>         14:20:45,799  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Schema Transaction started with connection 
> "org.datanucleus.store.rdbms.datasource.dbcp.PoolingDataSource$PoolGuardConnectionWrapper@9a8252e"
>  with isolation "serializable"
>
>         14:20:45,800  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Check of existence of ProfileElement returned table type of TABLE
>
>         14:20:45,800  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Loading column info for table(s) "Assessment, 
> DropDownForProfileElement, Config, Supply, TagHolder, Demand, 
> PersistedProfileElementComparison, DemandAssessment, ProfileMatch, 
> SystemRole, IsisSecurityApplicationUser, TagCategory, 
> ProfileElementTypeMatchingRule, Actor, Tag, ProfileTypeMatchingRule, System, 
> ProfileComparison, Competence, ProfileAssessment, OrganisationRole, 
> CompetenceCategory, IsisSecurityApplicationTenancy, Profile, Organisation, 
> ProfileElement, IsisSecurityApplicationPermission, 
> IsisSecurityApplicationRole, IsisSecurityApplicationUserRoles, 
> MatchingTrustedContact, Role, SupplyAssessment, Person, PersonRole" in 
> Catalog "", Schema ""
>
>         14:20:45,873  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Column info loaded for Catalog "", Schema "", 34 tables, time = 73 ms
>
>         14:20:45,873  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Column info retrieved for table "ProfileElement" : 15 columns found
>
>         14:20:45,873  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Creating column startDate for table ProfileElement
>
>         14:20:45,873  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  Creating column endDate for table ProfileElement
>
>         14:20:45,873  [Schema               1593650877@qtp-1528405038-0 
> DEBUG]  ALTER TABLE ProfileElement ADD COLUMN startDate DATE NULL
>
>
>

         

Reply via email to