別のテーブルを持つ別のデータベース (SQL サーバー) に接続しようとしています。なんとか接続できましたが、別のデータベースの同じテーブルを検索します。
どのデータベーステーブルが必要で、どのテーブルがそうでないかをどのように言いますか?
実在物 :
@Entity(name = "ripError")
@Table(name = "rip_error")
public class RipError {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name = "deleted")
private char deleted;
@Column(name = "error_code")
private String errorCode;
@Column(name = "error_desc")
private String errorDesc;
}
spring-data.xml
<context:property-placeholder properties-ref="deployProperties" />
<tx:annotation-driven transaction-manager="transactionManager" />
<!-- Activate Spring Data JPA repository support -->
<jpa:repositories base-package="com.worldone.repository" entity-manager-factory-ref="entityManagerFactory" transaction-manager-ref="transactionManager" />
<jpa:repositories base-package="com.worldone.repositoryMetal" entity-manager-factory-ref="entityManagerFactoryMetal" transaction-manager-ref="transactionManagerMetal" />
<!-- Declare a datasource that has pooling capabilities-->
<bean id="jpaDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close"
p:driverClass="${app.jdbc.driverClassName}"
p:jdbcUrl="${app.jdbc.url}"
p:user="${app.jdbc.username}"
p:password="${app.jdbc.password}"
p:acquireIncrement="5"
p:idleConnectionTestPeriod="60"
p:maxPoolSize="100"
p:maxStatements="50"
p:minPoolSize="10"
/>
<bean id="jpaDataSourceMetal" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close"
p:driverClass="${app2.jdbc.driverClassName}"
p:jdbcUrl="${app2.jdbc.url}"
p:user="${app2.jdbc.username}"
p:password="${app2.jdbc.password}"
p:acquireIncrement="5"
p:idleConnectionTestPeriod="60"
p:maxPoolSize="100"
p:maxStatements="50"
p:minPoolSize="10"
/>
<!-- Declare a JPA entityManagerFactory -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:persistenceXmlLocation="classpath*:META-INF/persistence.xml"
p:persistenceUnitName="hibernatePersistenceUnit"
p:dataSource-ref="jpaDataSource"
p:jpaVendorAdapter-ref="hibernateVendor"/>
<!-- Declare a JPA entityManagerFactory -->
<bean id="entityManagerFactoryMetal" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:persistenceXmlLocation="classpath*:META-INF/persistence.xml"
p:persistenceUnitName="hibernatePersistenceUnitMetal"
p:dataSource-ref="jpaDataSourceMetal"
p:jpaVendorAdapter-ref="hibernateVendorMetal"/>
<!-- Specify our ORM vendor -->
<bean id="hibernateVendor" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:showSql="false"/>
<!-- Specify our ORM vendor -->
<bean id="hibernateVendorMetal" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:showSql="false"/>
<!-- Declare a transaction manager-->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
p:entityManagerFactory-ref="entityManagerFactory"
/>
<!-- Declare a transaction manager-->
<bean id="transactionManagerMetal" class="org.springframework.orm.jpa.JpaTransactionManager"
p:entityManagerFactory-ref="entityManagerFactoryMetal"/>
これはエラーです:
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: hibernatePersistenceUnitMetal] Unable to build EntityManagerFactory
Caused by: org.hibernate.HibernateException: Missing table: rip_error