クラス変数にcamel casing
.This という名前を付けました。これが原因と思われるクラスです。
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.sql.Date;
public class GameBoard
{
@Temporal(TemporalType.DATE)
private Date lastMoveDate;
/**
* @return the lastMoveDate
*/
public Date getLastMoveDate() {
return lastMoveDate;
}
/**
* @param lastMoveDate the lastMoveDate to set
*/
public void setLastMoveDate(Date lastMoveDate) {
this.lastMoveDate = lastMoveDate;
}
}
クラスにはplayerOneFk
、 、などの他の変数がいくつかplayerTwoFk
ありますgameLobbyFk
(hibernate はsetter-getter
これらの変数でそれぞれを追跡できますが、列で例外をスローしていlast_move_date
ます)。
また、メソッド名setlastMoveDate
とgetlastMoveDate
(運が悪かった..)、プロパティ..も試しましたlastMoveDate
<property name="lastMoveDate" type="date" column="last_move_date" />
そしてキャッチされた例外
SEVERE: Servlet.service() for servlet [authapi] in context with path [/TTTserver] threw exception [Servlet execution threw an exception] with root cause
org.hibernate.PropertyNotFoundException: Could not find a getter for lastMoveDate in class com.hib.objects.GameBoard
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
at org.hibernate.mapping.Property.getGetter(Property.java:272)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:247)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:125)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at com.hib.objects.HibernateUtil.<clinit>(HibernateUtil.java:24)
at nz.ac.massey.cs.capstone.auth.authapi.processRequest(authapi.java:42)
at nz.ac.massey.cs.capstone.auth.authapi.doGet(authapi.java:74)