Hi all, I have an entity PromotionEvent that extends Promotion: @Entity @Table(name = "promotion_event") @PrimaryKeyJoinColumn(name = "promotion_id") @DiscriminatorValue("event") @XmlRootElement public class PromotionEvent extends Promotion {
@Basic(optional = false) @Column(name = "start_time", nullable = false) @Temporal(TemporalType.TIME) private Date startTime; @Basic(optional = false) @Column(name = "end_time", nullable = false) @Temporal(TemporalType.TIME) private Date endTime; @Basic(optional = false) @Column(name = "week_day", nullable = false, length = 11) private String weekDay;
And when try to store PromotionEvent I get the following exception: ERROR pool-2-thread-2 SqlExceptionHelper.logExceptions - Parameter index out of range (16 > number of parameters, which is 15). With the insert: insert into promotion (amount, client_id, description, end_datetime, event_end_datetime, event_start_datetime, hide_amount_at_ticket, name, percentage, promotion_type, requires_pda_alert, short_name, show_amount_original_at_ticket, start_datetime, state, status) values (?, ?, ?, ?, ?, ?, ?, ?, ?, 'event', ?, ?, ?, ?, ?, ?)
in my store method: public void store(PromotionEvent promotionEvent) {
session.saveOrUpdate(promotionEvent);
}
Promtion has: @Entity @Table(name = "promotion") @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "promotion_type", discriminatorType = DiscriminatorType.STRING) @XmlRootElement public class Promotion implements Serializable {
private static final long serialVersionUID = 1L;
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "promotion_id", nullable = false) protected Integer promotionId; .... ..... ....
I using Hibernate 5.1.2 Best regards.
|