启动应用程序时出现此错误
Caused by: org.dbunit.dataset.NoSuchColumnException: CLIENT.ID - (Non-uppercase input column: ID) in ColumnNameToIndexes cache map. Note that the map's column names are NOT case sensitive
我不太确定我为什么会得到这个,因为我的表/列名称都以大写形式引用(即使消息坚持这不应该是问题)
我的桌子:
mysql> describe CLIENT;
+------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+----------------+
| ID | int(11) | NO | PRI | NULL | auto_increment |
| jdoDetachedState | tinyblob | YES | | NULL | |
| NAME | varchar(255) | NO | | NULL | |
| ADDRESS1 | varchar(255) | YES | | NULL | |
| ADDRESS2 | varchar(255) | YES | | NULL | |
| COUNTRY | varchar(255) | YES | | NULL | |
| COUNTY | varchar(255) | YES | | NULL | |
| MAINPHONENUMBER | varchar(255) | YES | | NULL | |
| POSTCODE | varchar(255) | YES | | NULL | |
| SECTOR | varchar(255) | YES | | NULL | |
| TOWN | varchar(255) | YES | | NULL | |
| WEBSITEURL | varchar(255) | YES | | NULL | |
+------------------+--------------+------+-----+---------+----------------+
12 rows in set (0.00 sec)
mysql>
我的域实体的片段:
@Id
@GeneratedValue
@Column(name="ID")
private Integer id;
我试图强制 DBUnit 使用的测试日期片段:
<dataset>
<CLIENT ID="-1"
ADDRESS1="Endeavour House"
ADDRESS2="Russell Rd"
COUNTRY="England"
COUNTY="Suffolk"
MAINPHONENUMBER="0845 606 6067"
NAME="Suffolk County Council"
POSTCODE="IP1 2BX"
SECTOR="Local Government"
TOWN="Ipswich"
WEBSITEURL="www.suffolk.gov.uk"/>
</dataset>
我想不出其他可以尝试的方法,删除了表并重新编译了 java 代码,有什么想法吗?