openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Łukasz Budnik" <lukasz.bud...@gmail.com>
Subject SchemaAction='refresh' - problem/question
Date Wed, 16 Jan 2008 16:51:40 GMT
Hi All!

The JPA manual says that 'refresh' action is equal to 'retain' and then 'add'.

Let's say I have a field like this:

protected String aaa;

and of course getter and setter:

    @Basic
    @Column(name = "AAA")
    public String getAaa() {
        return aaa;
    }

    public void setAaa(String value) {
        this.aaa = value;
    }

Let's say I made a typo, or simply I want to change aaa name to abc:

protected String abc; // plus rename of getter and setter

when I run the EntityManager, OpenJPA does not drop the old column.
Yes, new column is added.

There is also drop action, the OpenJPA manual says:

drop: Drop all schema components in the schema XML. Tables will only
be dropped if they would have 0 columns after dropping all columns
listed in the XML

but my entity (listed in XML) does not define aaa field any more, so
there will be at least one column left as a result of which whole
table won't be droped.

any ideas how to get drop old columns?

best regards
Łukasz
Mime
View raw message