Polymorphic persistence with hibernate

Hello everyone , I have been trying all day to persist an entity “resultatRAT”


@Table(name = "resultat_rat")
@Inheritance(strategy = InheritanceType.JOINED) 
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ResultatRAT extends Resultat implements Serializable {
    private static final long serialVersionUID = 1L;

    @Column(name = "montant_remboursement", nullable = false)
    private Float montantRemboursement;

    @Column(name = "pre_solde_dispo", nullable = false)
    private Float preSoldeDispo;

    @Column(name = "post_solde_dispo", nullable = false)
    private Float postSoldeDispo;

    @Column(name = "duree_restante", nullable = false)
    private Integer dureeRestante;

    @Column(name = "pre_echeance", nullable = false)
    private Float preEcheance;

    @Column(name = "post_echeance", nullable = false)
    private Float postEcheance;

    @Column(name = "capital_amorti", nullable = false)
    private Float capitalAmorti;

    @Column(name = "capital_restant_du", nullable = false)
    private Float capitalRestantDu;

    @Column(name = "mnt_penalite_ht", nullable = false)
    private Float mntPenaliteHT;

    @Column(name = "taxe_penalite_ht", nullable = false)
    private Float taxePenaliteHT;

// Getters and setter omitted for brevity

this is the mother class “Resultat”


@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "resultat")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@DiscriminatorColumn(name = "typeSimulation", discriminatorType = DiscriminatorType.STRING)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME
    , property = "typeSimulation")
        @JsonSubTypes.Type(value = ResultatRAP.class, name = "REMBOURSEMENT_PARTIEL"),
        @JsonSubTypes.Type(value = ResultatRAT.class, name = "REMBOURSEMENT_TOTAL"),
public abstract class Resultat implements Serializable {

    private static final long serialVersionUID = 1L;

    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    @OneToOne(mappedBy = "resultat", cascade = CascadeType.PERSIST, orphanRemoval = true)
    private Simulation simulation;

    @Column(name = "typeSimulation", nullable = false)
    private TypeSimulation typeSimulation; 
// Getters and setter omitted for brevity

but each attempt have been a failure , the post method is pretty standard

    public Resultat createResultat(@RequestBody Resultat resultat) throws URISyntaxException {
        if (resultat.getId() != null) {
            throw new BadRequestAlertException("A new resultat cannot already have an ID", ENTITY_NAME, "idexists");
        Resultat result = resultatRepository.save(resultat);
        return result;

and this is my JSON object


each time I request my object to be persisted I get this error

Invalid value “1” for parameter “parameterIndex” [90008-200]

Any idea on how to solve this problem? Thank you very much

Which Hibernate version and what database + dialect are you using? The queries for tables with identity strongly depend on the identity support the dialect provides. Maybe you chose the wrong dialect, or you are running into a bug that has been fixed in a newer version.