Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Does it possible to sync a bean and a table?

Some of the multi-tenant and extensibility work we have been doing is moving in the direction of being to alter tables. At the moment, it is still in the planning phases of that part of the project.

One thing you could do with the current code base is define a table that had some generic "holder" columns and then take advantage of our extensibility support to map dynamically change your mappings to use those columns.

http://wiki.eclipse.org/EclipseLink/Examples/JPA/Extensibility

-Tom

Laird Nelson wrote:
In JPA?  No.  In EclipseLink?  Sort of.

People on this list are going to point you to the eclipselink.ddl-generation property (http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_%28ELUG%29#Using_EclipseLink_JPA_Extensions_for_Schema_Generation).

But bear in mind this will not alter tables. It will only create them and/or drop them.

You might look at http://www.liquibase.org/ for a database versioning/migration tool. It is not what you are asking for, but for production support of databases you'll find that automatic initial DDL generation isn't all that great anyway.

Best,
Laird

On Fri, Sep 23, 2011 at 1:24 PM, Shai Amar <shai.amar@xxxxxxxxxxxxxx <mailto:shai.amar@xxxxxxxxxxxxxx>> wrote:

    Hi

I want to know if there is a mechanism in JPA that does the following:
       1. If I'm creating a bean it generate the table automatically
       2. If I'm changing one of the bean data members, the table
          columns changing respectively

    And generally, is there a mechanism that enable a synchronization
between the bean and the table? -- Regards

    Shai Amar

    Technologies manager, Founder
    Krynnlance
    www.krynnlance.com <http://www.krynnlance.com/>
    www.backapps.com <http://www.backapps.com/>


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




--
http://about.me/lairdnelson


------------------------------------------------------------------------

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


Back to the top