使用 EclipseLink 从实体生成表不执行任何操作

Generating tables from Entities with EclipseLink does nothing

我正在尝试从 SQL 服务器数据库生成实体并将所述表生成到 MySQL 数据库中。我使用 JPA 工具成功生成了实体,现在我拥有与此类似的实体:

@Entity
//It was originally the @Table annotation, I changed it just to see if
//it would work like this
@TableGenerator(name="AGENCY",schema="amex_digital_test_dev")
@NamedQuery(name="Agency.findAll", query="SELECT a FROM Agency a")
public class Agency implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(unique=true, nullable=false)
private int IDAgency;

@Column(name="Channel_Code")
private String channel_Code;

@Column(name="CodiceOAM")
private String codiceOAM;

@Column(name="DistributionList")
private String distributionList;

@Column(name="IsSimpleSignature")
private boolean isSimpleSignature;

@Column(name="Name", nullable=false)
private String name;

public Agency() {
}

public int getIDAgency() {
    return this.IDAgency;
}

public void setIDAgency(int IDAgency) {
    this.IDAgency = IDAgency;
}

public String getChannel_Code() {
    return this.channel_Code;
}

public void setChannel_Code(String channel_Code) {
    this.channel_Code = channel_Code;
}

public String getCodiceOAM() {
    return this.codiceOAM;
}

public void setCodiceOAM(String codiceOAM) {
    this.codiceOAM = codiceOAM;
}

public String getDistributionList() {
    return this.distributionList;
}

public void setDistributionList(String distributionList) {
    this.distributionList = distributionList;
}

public boolean getIsSimpleSignature() {
    return this.isSimpleSignature;
}

public void setIsSimpleSignature(boolean isSimpleSignature) {
    this.isSimpleSignature = isSimpleSignature;
}

public String getName() {
    return this.name;
}

public void setName(String name) {
    this.name = name;
}

 }

我的persistence.xml:

 <?xml version="1.0" encoding="UTF-8"?>
 <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns   /persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="JPAAmex" transaction-type="RESOURCE_LOCAL">
    <class>com.olsa.amex.entities.Agency</class>
    <class>com.olsa.amex.entities.AgencyRegionView</class>
    <class>com.olsa.amex.entities.Agent</class>
    <class>com.olsa.amex.entities.AgentAgencyRegionAndSubRegionRel</class>
    <class>com.olsa.amex.entities.AgentAgencyRegionAndSubRegionRelBackUp</class>
    <class>com.olsa.amex.entities.AgentGroup</class>
    <class>com.olsa.amex.entities.AgentsInfo</class>
    <class>com.olsa.amex.entities.AmexStatoPriorita</class>
    <class>com.olsa.amex.entities.AmexXEROXField</class>
    <class>com.olsa.amex.entities.AmexXEROXSection</class>
    <class>com.olsa.amex.entities.Application</class>
    <class>com.olsa.amex.entities.ApplicationField</class>
    <class>com.olsa.amex.entities.ApplicationFieldBk</class>
    <class>com.olsa.amex.entities.ApplicationFieldBkWithAttachGood</class>
    <class>com.olsa.amex.entities.ApplicationFieldStatus</class>
    <class>com.olsa.amex.entities.ApplicationFieldTemplate</class>
    <class>com.olsa.amex.entities.ApplicationFieldTemplateFixedValue</class>
    <class>com.olsa.amex.entities.ApplicationOfferAndRegionRel</class>
    <class>com.olsa.amex.entities.ApplicationOfferSuppBaseRel</class>
    <class>com.olsa.amex.entities.ApplicationPacakge</class>
    <class>com.olsa.amex.entities.ApplicationPackageArkDap</class>
    <class>com.olsa.amex.entities.ApplicationProductOffer</class>
    <class>com.olsa.amex.entities.ApplicationSection</class>
    <class>com.olsa.amex.entities.ApplicationSectionPdf</class>
    <class>com.olsa.amex.entities.ApplicationSectionTemplate</class>
    <class>com.olsa.amex.entities.ApplicationSignaturePDF</class>
    <class>com.olsa.amex.entities.ApplicationStatus</class>
    <class>com.olsa.amex.entities.ApplicationTemplate</class>
    <class>com.olsa.amex.entities.ApplicationTemplateBackUp</class>
    <class>com.olsa.amex.entities.ApplicationTrace</class>
    <class>com.olsa.amex.entities.AreaRegion</class>
    <class>com.olsa.amex.entities.AreaSubRegion</class>
    <class>com.olsa.amex.entities.AreamanagerAgent</class>
    <class>com.olsa.amex.entities.BankList</class>
    <class>com.olsa.amex.entities.BankList_old</class>
    <class>com.olsa.amex.entities.BankList_two</class>
    <class>com.olsa.amex.entities.Cab</class>
    <class>com.olsa.amex.entities.CabList</class>
    <class>com.olsa.amex.entities.CabList_old</class>
    <class>com.olsa.amex.entities.CervedCredenzial</class>
    <class>com.olsa.amex.entities.Comuni</class>
    <class>com.olsa.amex.entities.Comuni_bck_20181227</class>
    <class>com.olsa.amex.entities.Comuni_bck_old</class>
    <class>com.olsa.amex.entities.ConfigurazioneSegnalazione</class>
    <class>com.olsa.amex.entities.Cordinate_Firma_Agente</class>
    <class>com.olsa.amex.entities.Crif</class>
    <class>com.olsa.amex.entities.DboApplicationPacakge</class>
    <class>com.olsa.amex.entities.ErrorSqlTrace</class>
    <class>com.olsa.amex.entities.InternationalTelPrefix</class>
    <class>com.olsa.amex.entities.Level_Rule</class>
    <class>com.olsa.amex.entities.Nazionalita</class>
    <class>com.olsa.amex.entities.NazioniIso</class>
    <class>com.olsa.amex.entities.New</class>
    <class>com.olsa.amex.entities.SBS_OfferList</class>
    <class>com.olsa.amex.entities.SectionStatus</class>
    <class>com.olsa.amex.entities.SegnalazioneApplicationSection</class>
    <class>com.olsa.amex.entities.Segnalazioni</class>
    <class>com.olsa.amex.entities.StorageCervedVisure</class>
    <class>com.olsa.amex.entities.Sysdiagram</class>
    <class>com.olsa.amex.entities.Teamleader_AM</class>
    <class>com.olsa.amex.entities.TempSignersInfo</class>
    <class>com.olsa.amex.entities.TemplateAppkeyStore</class>
    <class>com.olsa.amex.entities.TipologiaSegnalazione</class>
    <class>com.olsa.amex.entities.TokenPushService</class>
    <class>com.olsa.amex.entities.UsedPassword</class>
    <class>com.olsa.amex.entities.VersionMobile</class>
    <class>com.olsa.amex.entities.VisureType</class>

    <properties>
        <property name="javax.persistence.jdbc.url" value="jdbc:mysql://rmarjboss-001c.customer.olsa:3306/amex_digital_test_dev"/>
        <property name="javax.persistence.jdbc.user" value="usrmysql"/>
        <property name="javax.persistence.jdbc.password" value="******"/>
        <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
        <property name="eclipselink.logging.level" value="FINEST"/>
        <property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
        <property name="eclipselink.composite-unit.member" value="true"/>
        <property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.MySQLPlatform"/>
        <property name="eclipselink.ddl-generation.output-mode" value="database" />
        <property name="eclipselink.create-ddl-jdbc-file-name" value="create.sql"/>
        <property name="eclipselink.deploy-on-startup" value="true" />
</properties>
</persistence-unit>

我通过转到 JPA 工具 --> 从实体生成表来启动该过程,然后弹出 windows:

我点击 "Finish",然后控制台出现,它没有给出任何错误,但它什么也没做:

 apr 03, 2019 2:36:11 PM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation
 INFO: HHH000204: Processing PersistenceUnitInfo [
name: JPAAmex
...]
 apr 03, 2019 2:36:11 PM org.hibernate.Version logVersion
 INFO: HHH000412: Hibernate Core {5.2.17.Final}
 apr 03, 2019 2:36:11 PM org.hibernate.cfg.Environment <clinit>
 INFO: HHH000206: hibernate.properties not found
apr 03, 2019 2:36:11 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
 INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
 apr 03, 2019 2:36:11 PM      org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvi     derImpl configure
 WARN: HHH10001002: Using Hibernate built-in connection pool (not for      production use!)
 apr 03, 2019 2:36:11 PM      org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvi     derImpl buildCreator
 INFO: HHH10001005: using driver [com.mysql.jdbc.Driver] at URL      [jdbc:mysql://rmarjboss-001c.customer.olsa:3306     /amex_digital_test_dev?useUnicode=yes&characterEncoding=UTF-8]
 apr 03, 2019 2:36:11 PM      org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvi     derImpl buildCreator
 INFO: HHH10001001: Connection properties: {user=usrmysql,      password=****}
 apr 03, 2019 2:36:11 PM      org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvi     derImpl buildCreator
 INFO: HHH10001003: Autocommit mode: false
 apr 03, 2019 2:36:11 PM      org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvi     derImpl$PooledConnections <init>
 INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
 Wed Apr 03 14:36:11 CEST 2019 WARN: Establishing SSL connection           without server's identity verification is not recommended. According to      MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be      established by default if explicit option isn't set. For compliance with      existing applications not using SSL the verifyServerCertificate property is      set to 'false'. You need either to explicitly disable SSL by setting      useSSL=false, or set useSSL=true and provide truststore for server      certificate verification.
 apr 03, 2019 2:36:12 PM org.hibernate.dialect.Dialect <init>
 INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL57Dialect
 apr 03, 2019 2:36:12 PM org.hibernate.mapping.RootClass      checkCompositeIdentifier
 WARN: HHH000038: Composite-id class does not override equals():      com.olsa.amex.entities.ApplicationTrace
 apr 03, 2019 2:36:12 PM org.hibernate.mapping.RootClass      checkCompositeIdentifier
 WARN: HHH000039: Composite-id class does not override hashCode():      com.olsa.amex.entities.ApplicationTrace
 apr 03, 2019 2:36:13 PM      org.hibernate.hql.internal.QueryTranslatorFactoryInitiator initiateService
 INFO: HHH000397: Using ASTQueryTranslatorFactory
 apr 03, 2019 2:36:13 PM      org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProvi     derImpl stop
 INFO: HHH10001008: Cleaning up connection pool      [jdbc:mysql://rmarjboss-001c.customer.olsa:3306     /amex_digital_test_dev?useUnicode=yes&characterEncoding=UTF-8]

我做错了什么吗?只生成这样的表格会节省我很多时间。在此先感谢您的帮助!

编辑:只需在此处添加一件事:我正在使用 JPA/Maven 项目

尝试通过 运行 独立 java 应用程序生成数据库..

public static void main(String...args){
    EntityManager em = Persistence.createEntityManagerFactory("JPAAmex").createEntityManager(); 
}