所属テーブルの作成
1 parent af08b66 commit 00457bcd1ba9b9bbbc6cebe428316703b645be9a
Narumasa Kande authored on 22 Jun 2019
Showing 3 changed files
View
32
src/test/java/hibernateTest/entities/Belong.java 0 → 100644
package hibernateTest.entities;
 
public class Belong {
private String uId, gId;
 
public Belong(){
 
}
 
public Belong(String uId, String gId){
setuId(uId);
setgId(gId);
}
 
private void setuId(String uId) {
this.uId = uId;
}
 
public String getuId() {
return uId;
}
 
private void setgId(String gId) {
this.gId = gId;
}
 
public String getgId() {
return gId;
}
 
}
View
24
src/test/resources/Belong.hbm.xml 0 → 100644
<?xml version="1.0"?>
 
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
-->
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
 
<hibernate-mapping package="hibernateTest.entities">
 
<class name="Belong" table="BELONGS">
<composite-id>
<key-property name="uId" column="UID"></key-property>
<key-property name="gId" column="GID"></key-property>
</composite-id>
 
</class>
 
</hibernate-mapping>
View
1
■■■■
src/test/resources/hibernate.cfg.xml
<mapping resource="Event.hbm.xml"/>
<mapping resource="User.hbm.xml"/>
<mapping resource="Group.hbm.xml"/>
<mapping resource="Request.hbm.xml"/>
<mapping resource="Belong.hbm.xml"/>
 
</session-factory>
 
</hibernate-configuration>