Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] HistoryPolicy - genenerate tables

Sorry for question I found 
330397 - HistoryTables should be automatically created 

https://bugs.eclipse.org/bugs/show_bug.cgi?id=330397

----- Original Message -----
From: "Janda Martin" <jandam@xxxxxxxxxx>
To: "eclipselink-users" <eclipselink-users@xxxxxxxxxxx>
Sent: Monday, October 10, 2011 11:22:30 AM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: [eclipselink-users] HistoryPolicy - genenerate tables

Hello all,

  I have question: Does HistoryPolicy support automatic generation of history table? EclipseLink 2.3 stable.

I have following setting in PU definition. Table for entity is dropped and then created. Table for history is not. Is this correct?

            <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>

Entity customizer:
    @Override
    public void customize(final ClassDescriptor descriptor) throws Exception {
        HistoryPolicy policy = new HistoryPolicy();
        policy.addHistoryTableName("ENTITY_HIST");
        policy.addStartFieldName("START_DATE");
        policy.addEndFieldName("END_DATE");
        policy.setShouldHandleWrites(true);
        descriptor.setHistoryPolicy(policy);
    }

After I create history table manually all history updates works as expected (persist, modify, delete).

  Thank you for help
    Martin

PS I can't find information about DDL generation for HistoryPolicy in examples and wiki.


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top