我有另一個問題(似乎是相同的事情:stored procedure 'auto_pk_for_table' not found)但我把自動增量和唯一索引的ID和'數據庫生成「在我的自動遞增字段主鍵,請參見:錯誤table.auto_pk_support當我嘗試在我的表中保存一個值
public abstract class _DateInfo extends CayenneDataObject {
public static final String ENDDATETIME_PROPERTY = "enddatetime";
public static final String STARTDATETIME_PROPERTY = "startdatetime";
public static final String USER_ID_PROPERTY = "userId";
public static final String DATEINFOID_PK_COLUMN = "DATEINFOID";
public static final String USERID_PK_COLUMN = "USERID";
public void setEnddatetime(Date enddatetime) {
writeProperty(ENDDATETIME_PROPERTY, enddatetime);
}
public Date getEnddatetime() {
return (Date)readProperty(ENDDATETIME_PROPERTY);
}
public void setStartdatetime(Date startdatetime) {
writeProperty(STARTDATETIME_PROPERTY, startdatetime);
}
public Date getStartdatetime() {
return (Date)readProperty(STARTDATETIME_PROPERTY);
}
public void setUserId(int userId) {
writeProperty(USER_ID_PROPERTY, userId);
}
public int getUserId() {
Object value = readProperty(USER_ID_PROPERTY);
return (value != null) ? (Integer) value : 0;
}
}
我試圖挽救當地的時間,當我點擊保存按鈕:
Button save = new Button("Save", event -> {
DateInfoFactory date = CayenneUtil.getContext().newObject(
DateInfoFactory.class);
date.setUserId(userIdSelected);
if (startTime.getValue() != null) {
LocalTime startDate = startTime.getValue();
date.setStartdatetime(toDate(startDate));
}
date.getObjectContext().commitChanges();
});
save.addStyleName(ValoTheme.BUTTON_PRIMARY);
但後來,我收到此錯誤:
juin 12, 2017 9:38:32 PM org.apache.cayenne.log.CommonsJdbcEventLogger logQuery
INFOS: LOCK TABLES AUTO_PK_SUPPORT WRITE
juin 12, 2017 9:38:32 PM org.apache.cayenne.log.CommonsJdbcEventLogger logQuery
INFOS: UNLOCK TABLES
juin 12, 2017 9:38:32 PM com.vaadin.server.DefaultErrorHandler doDefault
GRAVE:
org.apache.cayenne.CayenneRuntimeException: [v.4.0.M5 Feb 24 2017 07:47:55] Commit Exception
..
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mam.auto_pk_support' doesn't exist
我該怎麼辦?
謝謝,
'Table'mam.auto_pk_support'does not exist' - 檢查您定義表名的位置。看起來是不正確的。 – petey
一切都設置在卡宴和表名似乎很好。 mam是我的架構,datainfo是我的表名 – Bob