[
https://issues.apache.org/jira/browse/OPENJPA-2876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17364237#comment-17364237
]
ASF subversion and git services commented on OPENJPA-2876:
----------------------------------------------------------
Commit f8d258594f55cdf06db16f2321a6ae6c6342616e in openjpa's branch
refs/heads/master from Mark Struberg
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=f8d2585 ]
OPENJPA-2876 unit test to show wrong SQL
sqlAction=refresh right now also generates the full DB.
> running 'refresh' schema action creates wrong SQL output
> --------------------------------------------------------
>
> Key: OPENJPA-2876
> URL: https://issues.apache.org/jira/browse/OPENJPA-2876
> Project: OpenJPA
> Issue Type: Bug
> Components: sql
> Affects Versions: 3.0.0
> Reporter: Mark Struberg
> Assignee: Mark Struberg
> Priority: Major
> Fix For: 3.2.1
>
>
> Seems we trashed the SQL refresh feature along the way to JPA-2.0.
> I have a sample with an Entity 'Customer' with just an ID. Then I add a
> column {{OTHER_NAME}} and generate the result with {{sqlAction=refresh}}
> In OpenJPA-2.4.3 we get the following output:
> {noformat}
> ALTER TABLE CUSTOMER ADD COLUMN OTHER_NAME VARCHAR(255);
> {noformat}
> In OpenJPA-3.0.0 onwards we get this:
> {noformat}
> ALTER TABLE CUSTOMER ADD COLUMN OTHER_NAME VARCHAR(255);
> CREATE TABLE CUSTOMER (ID BIGINT NOT NULL, active VARCHAR(1), OTHER_NAME
> VARCHAR(255), specialCustomer VARCHAR(1) NOT NULL, PRIMARY KEY (ID));
> CREATE TABLE OPENJPA_SEQUENCE_TABLE (ID TINYINT NOT NULL, SEQUENCE_VALUE
> BIGINT, PRIMARY KEY (ID));
> CREATE TABLE PUBLIC.CUSTOMER (ID BIGINT, ACTIVE VARCHAR(1), NAME
> VARCHAR(255), SPECIALCUSTOMER VARCHAR(1));
> {noformat}
> It seems like we do not only run the MappingAction 'refresh' but also a
> 'build' plus we do it also without Schema and with the current Schema
> (PUBLIC).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)