我有以下 Java 6 代码:
Query q = em.createNativeQuery(
"select T.* " +
"from Trip T join Itinerary I on (T.itinerary_id=I.id) " +
"where I.launchDate between :start and :end " +
"or ADDDATE(I.launchDate, I.equipmentPullDayOfTrip) between :start and :end",
"TripResults" );
q.setParameter( "start", range.getStart(), TemporalType.DATE );
q.setParameter( "end", range.getEnd(), TemporalType.DATE );
@SqlResultSetMapping( name="TripResults",
entities={
@EntityResult( entityClass=TripEntity.class ),
@EntityResult( entityClass=CommercialTripEntity.class )
}
)
我在最后一个右括号上收到语法错误。Eclipse 给出:“插入 EnumBody 以完成块语句”和“插入枚举标识符以完成 EnumHeaderName”。来自 javac 的类似语法错误。
我究竟做错了什么?