Eclipse で再現できない奇妙なエラーがサーバーに表示されます。
言います:
Caused by: java.sql.BatchUpdateException: Batch entry 0
update public.user set
is_at='[B@136ef65',
user_name='elk',
password='33e79218965eb72c92a549dd5a330113',
location_precision=NULL,
location_simulated=NULL,
active=NULL,
last_seen_at='2013-02-20 08:13:45.992000 +01:00:00',
app_uuid=NULL,
avatar_url='http://server.org/img/avatars/10.png',
email='mail@mail.com',
score=NULL,
phrase='hibernate fail',
state=NULL,
reputation=NULL,
reputation_desc=NULL,
privacy_settings='visibleForAll',
gender='male',
email_verified='1',
geom='SRID=4326;POINT(2.209740161895752 41.400447845458984)'
where user_id='[B@19ee400'
was aborted. Call getNextException to see the cause.
続いて
java.lang.IllegalArgumentException: id to load is required for loading
(hibernate?) が属性 is_at および user_id を文字列に変換できないため、失敗します。オブジェクトのバイナリ表現のようなものでクエリをパラメータ化しようとしているようです。
関連する hbm.xml スニペット:
<id name="userId" type="java.lang.Long">
<column name="user_id" />
<generator class="sequence">
<param name="sequence">user_user_id_seq</param>
</generator>
</id>
<many-to-one name="checkin" class="org.server.entity.Checkin" fetch="select">
<column name="is_at" />
</many-to-one>
私は奇妙なものは何も見えません。奇妙なことは、私の IDE で動作していることです。誰かが同様のエラーを見たことがありますか?
休止状態: 3.6.2
バージョン tomcat 6.0.33
Java openjdk 1.6.0.18
postgresql: 8.3.9
アップデート:
このための Java コード:
// queryHistory is to be persisted
// user is not null
queryHistory.setUser(user);
queryHistory.setApiKey(apiKey);
// create point
Coordinate coordinate = new Coordinate(queryHeader.getLocLon(),queryHeader.getLocLat());
GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(),4326);
Point point = geometryFactory.createPoint(coordinate);
queryHistory.setGeom(point);
if(user!=null) {
user.setGeom(point);
user.setLastSeenAt(new Timestamp(new Date().getTime()));
hSession.update(user);
}
hSession.persist(queryHistory);
t.commit();
前もって感謝します