ストラットとデータベースへのレコードの挿入に問題があります
データベースはこんな感じ
マップは次のとおりです。
<mapper namespace="Employees">
<resultMap id="employeeMap" type="employee">
<id column="employeeID" property="employeeID" />
<result column="employeeNum" property="employeeNum" />
<result column="username" property="userName" />
<result column="firstName" property="firstName" />
<result column="lastName" property="lastName" />
<association property="address" column="addressID" resultMap="addressMap" />
</resultMap>
<resultMap id="addressMap" type="address">
<id column="addressID" property="id" />
<result column="addressLine1" property="addressLine1" />
<result column="addressLine2" property="addressLine2" />
<result column="city" property="city" />
<result column="postcode" property="postcode" />
<result column="country" property="country" />
</resultMap>
これは従業員オブジェクトです:
public class Employee{
private static final long serialVersionUID = 1L;
private int employeeID;
private String employeeNum;
private String firstName;
private String lastName;
上記の関係を保存することに関して、私のテーブルはどのように見えるべきですか?
この時点で、Employees テーブルは次のようになります。
そして、「addressIDにデフォルト値がありません」のようなエラーが表示され続けます すべてが正しい方法でレイアウトされていますか、それとも何か不足していますか?