-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: java.sql.BatchUpdateException: expected NUMBER got BINARY
PostPosted: Wed May 02, 2012 1:27 pm 
Newbie

Joined: Thu Apr 14, 2011 4:11 am
Posts: 6
Hi everyone,

I have a serious trouble with hibernate and am not sure how to solve it.

For the three entities Wagen, KleinstesCluster and WagenVerfuegungsBerechtigter (see below):
Code:
package de.db.ewds.common.datamodel.entities;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.PersistenceContext;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import de.db.ewds.application.entity.VersionedEntityImpl;
import de.db.ewds.common.datamodel.valuetypes.WagenNumber;

/**
* Wagen Entity
*
* @author LeventKent
* @version 1.0
* @created 02-Apr-2012 14:43:36
*/
@Entity
@Table(name = "WAGEN")
@PersistenceContext(unitName = "ewds-unit")
@NamedQueries( { @NamedQuery(name = "findEditableWagenByWagenNumber", query = //
"FROM Wagen w WHERE w.wagenNumber.value = :wagenNumber"),
@NamedQuery(name = "findWagenByImportedFlag", query = //
"FROM Wagen w " + "WHERE w.recentlyImported = :recentlyImported") })
public class Wagen extends VersionedEntityImpl {

    /**
     * Serial version
     */
    private static final long serialVersionUID = -9088083321590338264L;

    private WagenNumber wagenNumber;

    private KleinstesCluster associatedKleinstesCluster;

    private Boolean recentlyImported = false;

    /**
     * @return the isRecentlyImported
     */
    @Column(name = "RECENTLY_IMPORTED")
    public Boolean getRecentlyImported() {
        return recentlyImported;
    }

    /**
     * @param isRecentlyImported
     *            the isRecentlyImported to set
     */
    public void setRecentlyImported(Boolean isRecentlyImported) {
        this.recentlyImported = isRecentlyImported;
    }

    /**
     * @return the kleinstesCluster
     */
    @ManyToOne(targetEntity = KleinstesCluster.class, cascade= CascadeType.ALL)
    @JoinColumn(name = "KLEINSTESCLUSTER_ID")
    public KleinstesCluster getAssociatedKleinstesCluster() {
        return associatedKleinstesCluster;
    }

    /**
     * @param kleinstesCluster
     *            the kleinstesCluster to set
     */
    public void setAssociatedKleinstesCluster(KleinstesCluster kleinstesCluster) {
        this.associatedKleinstesCluster = kleinstesCluster;
    }

    /**
     * @return the wagenNumber
     */
    @Embedded
    public WagenNumber getWagenNumber() {
        return this.wagenNumber;
    }

    /**
     * @param aWagenNumber
     *            the aWagenNumber to set
     */
    public void setWagenNumber(WagenNumber wagenNumber) {
        this.wagenNumber = wagenNumber;
    }

    @Override
    @Id
    @SequenceGenerator(name = "WAGEN_SEQ", sequenceName = "WAGEN_SEQ", initialValue = 1, allocationSize = 100)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "WAGEN_SEQ")
    public Long getId() {
        return super.getId();
    }

    @Transient
    @Override
    public boolean isModified(VersionedEntityImpl original) {
        return this.equals(original);
    }

}

Code:
package de.db.ewds.common.datamodel.entities;

import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.PersistenceContext;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cascade;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
import org.hibernate.validator.Valid;

import de.db.ewds.application.entity.VersionedEntityImpl;

/**
* @author LeventKent
* @version 1.0
* @created 02-Apr-2012 14:43:36
*/
@Entity
@Table(name = "WVB")
@PersistenceContext(unitName = "ewds-unit")
@NamedQueries( { @NamedQuery(name = "findEditableWvbBySearchParameter", query = //
"FROM WagenVerfuegungsBerechtigter w WHERE " + //
        "w.partnerId = :partnerId AND " + //
        "w.bahnVerwaltungsNumber = :bahnVerwaltungsNumber"),
@NamedQuery(name = "findWvbByImportedFlag", query = //
"FROM WagenVerfuegungsBerechtigter w " + "WHERE w.recentlyImported = :recentlyImported") })
public class WagenVerfuegungsBerechtigter extends VersionedEntityImpl {

    /**
     * Serial Version
     */
    private static final long serialVersionUID = 8831314915203256993L;

    /**
     * Maximum length of unternehmenscode
     */
    public static final int UNTERNEHMENSCODE_LENGTH = 4;

    /**
     * Maximum length of bahnverwaltungsnummer
     */
    public static final int BAHNVERWALTUNGSNUMBER_LENGTH = 6;

    /**
     * Maximum length of partnerid (attribute wagenverfuegeungsberechtigter in business class of design team)
     */
    public static final int PARTNER_ID_LENGTH = 8;

    /**
     * Maximum length of WVB_Name
     */
    public static final int NAME_LENGTH = 70;

    private String bahnVerwaltungsNumber;

    private String partnerId;

    private String unternehmensCode;

    private String name;

    // Associations
    private Collection<KleinstesCluster> kleinsteCluster = new ArrayList<KleinstesCluster>();

    private Boolean recentlyImported = false;

    /**
     * @param kleinsteCluster
     *            the kleinsteCluster to set
     */
    protected void setKleinsteCluster(Collection<KleinstesCluster> kleinsteCluster) {
        this.kleinsteCluster = kleinsteCluster;
    }

    public WagenVerfuegungsBerechtigter() { // For JPA
        super();
    }

    public WagenVerfuegungsBerechtigter(String bahnVerwaltungsNumber, String partnerId, String unternehmensCode,
            String name) {
        super();
        this.bahnVerwaltungsNumber = bahnVerwaltungsNumber;
        this.partnerId = partnerId;
        this.unternehmensCode = unternehmensCode;
        this.name = name;
    }

    /**
     * @return the isRecentlyImported
     */
    @Column(name = "RECENTLY_IMPORTED", nullable = false)
    @NotNull
    public Boolean getRecentlyImported() {
        return recentlyImported;
    }

    /**
     * @param isRecentlyImported
     *            the isRecentlyImported to set
     */
    public void setRecentlyImported(Boolean isRecentlyImported) {
        this.recentlyImported = isRecentlyImported;
    }

    @Column(length = BAHNVERWALTUNGSNUMBER_LENGTH, name = "BAHNVERWALTUNGSNUMMER")
    @NotNull(message = "{wagenverfuegungsberechtigter.bahnverwaltungsnummer.empty}")
    @Length(max = BAHNVERWALTUNGSNUMBER_LENGTH, message = "{wagenverfuegungsberechtigte.bahnverwaltungsnummer.length}")
    public String getBahnVerwaltungsNumber() {
        return this.bahnVerwaltungsNumber;
    }

    public void setBahnVerwaltungsNumber(String bahnVerwaltungsNumber) {
        this.bahnVerwaltungsNumber = bahnVerwaltungsNumber;
    }

    @OneToMany(mappedBy = "wvb", cascade = CascadeType.ALL, targetEntity = KleinstesCluster.class)
    @Cascade( { org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
    @Valid
    public Collection<KleinstesCluster> getKleinsteCluster() {
        return this.kleinsteCluster;
    }

    @Column(length = PARTNER_ID_LENGTH, name = "PARTNERID")
    @NotNull(message = "{wagenverfuegungsberechtigter.partnerid.empty}")
    @Length(max = PARTNER_ID_LENGTH, message = "{wagenverfuegungsberechtigte.partnerid.length}")
    public String getPartnerId() {
        return this.partnerId;
    }

    public void setPartnerId(String partnerId) {
        this.partnerId = partnerId;
    }

    @Column(length = UNTERNEHMENSCODE_LENGTH, name="UNTERNEHMENSCODE")
    @NotNull(message = "{wagenverfuegungsberechtigter.unternehmenscode.empty}")
    @Length(max = UNTERNEHMENSCODE_LENGTH, message = "{wagenverfuegungsberechtigter.unternehmenscode.length}")
    public String getUnternehmensCode() {
        return this.unternehmensCode;
    }

    public void setUnternehmensCode(String unternehmensCode) {
        this.unternehmensCode = unternehmensCode;
    }

    @Column(length = NAME_LENGTH, name="NAME")
    @NotNull(message = "{wagenverfuegungsberechtigter.name.empty}")
    @Length(max = NAME_LENGTH, message = "{wagenverfuegungsberechtigter.unternehmenscode.length}")
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    @Id
    @SequenceGenerator(name = "WVB_SEQ", sequenceName = "WVB_SEQ", initialValue = 1, allocationSize = 100)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "WVB_SEQ")
    public Long getId() {
        return super.getId();
    }

    @Transient
    @Override
    public boolean isModified(VersionedEntityImpl original) {
        // TODO Auto-generated method stub
        return false;
    }

    public void addKleinstesCluster(KleinstesCluster kc) {
        this.kleinsteCluster.add(kc);
        kc.setWvb(this);
    }

}

Code:
package de.db.ewds.common.datamodel.entities;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.PersistenceContext;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
import org.joda.time.DateTime;

import de.db.ewds.application.entity.VersionedEntityImpl;
import de.db.ewds.common.datamodel.enumerations.Rating;

/**
* KleinstesCluster Entity
*
* @author LeventKent
* @version 1.0
* @created 02-Apr-2012 17:31:11
*/
@Entity
@Table(name = "KLEINSTESCLUSTER")
@PersistenceContext(unitName = "ewds-unit")
@NamedQueries( { @NamedQuery(name = "findEditableKcBySearchParameter", query = //
"FROM KleinstesCluster k " + "WHERE k.bauArt = :bauArt AND k.clusterNumber= :clusterNumber AND "
        + "k.special = :special AND k.classifiable = :classifiable AND "
        + "k.gattungInternational = :gattungInternational AND " + "k.gattungNational = :gattungNational AND "
        + "k.wvb.bahnVerwaltungsNumber = :locationPrefix AND " + "k.wvb.partnerId = :locationSuffix AND "
        + "k.wvb.unternehmensCode = :unternehmensCode"),
@NamedQuery(name = "findKcByImportedFlag", query = //
"FROM KleinstesCluster k " + "WHERE k.recentlyImported = :recentlyImported") })
public class KleinstesCluster extends VersionedEntityImpl {

    /**
     * Serial Version.
     */
    private static final long serialVersionUID = 5402359375216699087L;

    public KleinstesCluster(String bauArt, DateTime startDate, DateTime endDate, String gattungInternational,
            String gattungNational, String clusterNumber, Boolean classifiable, Integer positionInBitArray,
            Boolean special, Rating rating) {
        super();
        this.bauArt = bauArt;
        this.startDate = startDate;
        this.endDate = endDate;
        this.gattungInternational = gattungInternational;
        this.gattungNational = gattungNational;
        this.clusterNumber = clusterNumber;
        this.classifiable = classifiable;
        this.positionInBitArray = positionInBitArray;
        this.special = special;
        this.rating = rating;
    }

    /*
     * (non-Javadoc)
     *
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Transient
    @Override
    public boolean isModified(VersionedEntityImpl obj) {
        //TODO LKE
        return true;
    }

    /**
     * Maximum length of bauart
     */
    private static final int BAUART_LENGTH = 3;

    /**
     * Maximum length of gattung-international
     */
    private static final int GATTUNG_INTERNATIONAL_LENGTH = 12;

    /**
     * Maximum length of gattung-national
     */
    private static final int GATTUNG_NATIONAL_LENGTH = 3;

    /**
     * Maximum length of gattung
     */
    private static final int CLUSTERNUMBER_LENGTH = 7;

    private String bauArt;

    private DateTime startDate;

    private DateTime endDate;

    private String gattungInternational;

    private String gattungNational;

    private String clusterNumber;

    private Boolean classifiable;

    private Integer positionInBitArray;

    private Boolean special;

    private Rating rating;

    // Associations

    private WagenVerfuegungsBerechtigter wvb;

    private List<Wagen> associatedWagen = new ArrayList<Wagen>();

    private Boolean recentlyImported=false;

    // TODO do persistent during impl. of Wagentypen
    // private Collection<Wagentyp> associatedWagentypen;

    public KleinstesCluster() { // For JPA
        super();
    }

    @Column(length = BAUART_LENGTH, name = "BAUART")
    @NotNull(message = "{kleinstescluster.bauart.empty}")
    @Length(min = BAUART_LENGTH, max = BAUART_LENGTH, message = "{kleinstescluster.bauart.length}")
    public String getBauArt() {
        return this.bauArt;
    }

    public void setBauArt(String bauArt) {
        this.bauArt = bauArt;
    }

    /**
     *
     *
     * @return
     */
    @Column(name = "STARTDATE")
    public DateTime getStartDate() {
        return this.startDate;
    }

    public void setStartDate(DateTime startDate) {
        this.startDate = startDate;
    }

    @Column(name = "ENDDATE")
    public DateTime getEndDate() {
        return this.endDate;
    }

    public void setEndDate(DateTime endDate) {
        this.endDate = endDate;
    }

    @Column(name = "GATTUNG_INTERNATIONAL", length = GATTUNG_INTERNATIONAL_LENGTH)
    @NotNull(message = "{kleinstescluster.gattunginternational.empty}")
    @Length(min = GATTUNG_INTERNATIONAL_LENGTH, max = GATTUNG_INTERNATIONAL_LENGTH, message = "{kleinstescluster.gattunginternational.length}")
    public String getGattungInternational() {
        return this.gattungInternational;
    }

    public void setGattungInternational(String gattung) {
        this.gattungInternational = gattung;
    }

    /**
     * @return the gattungNational
     */
    @Column(name = "GATTUNG_NATIONAL", length = GATTUNG_NATIONAL_LENGTH)
    @NotNull(message = "{kleinstescluster.gattungnational.empty}")
    @Length(min = GATTUNG_NATIONAL_LENGTH, max = GATTUNG_NATIONAL_LENGTH, message = "{kleinstescluster.gattungnational.length}")
    public String getGattungNational() {
        return this.gattungNational;
    }

    /**
     * @param gattungNational
     *            the gattungNational to set
     */
    public void setGattungNational(String gattungNational) {
        this.gattungNational = gattungNational;
    }

    /**
     * @return
     */
    @Column(name = "CLUSTERNUMBER", length = CLUSTERNUMBER_LENGTH)
    @NotNull(message = "{kleinstescluster.clusternumber.empty}")
    @Length(min = CLUSTERNUMBER_LENGTH, max = CLUSTERNUMBER_LENGTH, message = "{kleinstescluster.clusternumber.length}")
    public String getClusterNumber() {
        return this.clusterNumber;
    }

    public void setClusterNumber(String clusterNumber) {
        this.clusterNumber = clusterNumber;
    }

    @Column(name = "CLASSIFIABLE", nullable = false)
    public Boolean getClassifiable() {
        return this.classifiable;
    }

    public void setClassifiable(Boolean classifiable) {
        this.classifiable = classifiable;
    }

    @Column(name = "POSITIONINBITARRAY", nullable = true)
    public Integer getPositionInBitArray() {
        return this.positionInBitArray;
    }

    public void setPositionInBitArray(Integer positionInBitArray) {
        this.positionInBitArray = positionInBitArray;
    }

    @Column(name = "SPECIAL", nullable = false)
    public Boolean getSpecial() {
        return this.special;
    }

    public void setSpecial(Boolean special) {
        this.special = special;
    }
   
    /**
     * @return the isRecentlyImported
     */
    @Column(name = "RECENTLY_IMPORTED")
    @NotNull
    public Boolean getRecentlyImported() {
        return recentlyImported;
    }

    /**
     * @param isRecentlyImported the isRecentlyImported to set
     */
    public void setRecentlyImported(Boolean isRecentlyImported) {
        this.recentlyImported = isRecentlyImported;
    }

    /**
     * @return
     */
    @Type(type = "de.db.ewds.application.valuetype.EnumValue", parameters = { @Parameter(name = "enumClass", value = "de.db.ewds.common.datamodel.enumerations.Rating") })
    public Rating getRating() {
        return this.rating;
    }

    public void setRating(Rating rating) {
        this.rating = rating;
    }

    @ManyToOne(targetEntity = WagenVerfuegungsBerechtigter.class)
    @JoinColumn(name = "WVB_ID")
    public WagenVerfuegungsBerechtigter getWvb() {
        return this.wvb;
    }

    public void setWvb(WagenVerfuegungsBerechtigter wvb) {
        this.wvb = wvb;
    }

    @OneToMany(mappedBy = "associatedKleinstesCluster",targetEntity = Wagen.class,
            cascade={CascadeType.MERGE, CascadeType.PERSIST})
    //@JoinColumn(name = "KLEINSTESCLUSTER_ID")
    //@Valid
    public List<Wagen> getAssociatedWagen() {
        return this.associatedWagen;
    }

    public void setAssociatedWagen(List<Wagen> associatedWagen) {
        this.associatedWagen = associatedWagen;
    }

    // TODO for Wagentyp development @ManyToMany(mappedBy="associatedKleinsteCluster")
    // public Collection<Wagentyp> getAssociatedWagentypen() {
    // return associatedWagentypen;
    // }

    // public void setAssociatedWagentypen(Collection<Wagentyp> associatedWagentypen) {
    // this.associatedWagentypen = assoklociatedWagentypen;
    // }
    //   
    @Override
    public KleinstesCluster clone() throws CloneNotSupportedException {
        return (KleinstesCluster) super.clone();
    }

    @Override
    @Id
    @SequenceGenerator(name = "KLEINSTESCLUSTER_SEQ", sequenceName = "KLEINSTESCLUSTER_SEQ", initialValue = 1, allocationSize = 100)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "KLEINSTESCLUSTER_SEQ")
    public Long getId() {
        return super.getId();
    }

    public void addWagen(Wagen w) {
        this.associatedWagen.add(w);
        w.setAssociatedKleinstesCluster(this);
    }
   
    /**
     * Transient getter for GUI.
     * @return
     */
    @Transient
    public String getClusterNumberPartOne() {
        if (clusterNumber != null && clusterNumber.length() >= 3) {
            return clusterNumber.substring(0, 3);
        }
        return new String();
    }

    /**
     * Transient getter for GUI.
     *
     * @return
     */
    @Transient
    public String getClusterNumberPartTwo() {
        if (clusterNumber != null && clusterNumber.length() >= 6) {
            return clusterNumber.substring(3, 6);
        }
        return new String();
    }
}


I have the following respective tables:

Code:
-- ========================================================================
-- Tables
-- ========================================================================

-- ------------------------------------------------------------------------
-- Creation of Kleinste Cluster
-- ------------------------------------------------------------------------
CREATE TABLE EWDS_OWNER.KLEINSTESCLUSTER (
                             ID  NUMBER(19,0) NOT NULL ENABLE,
                             VERSION  NUMBER(19,0),
                             BAUART  VARCHAR2(3 CHAR),
                             GATTUNG_INTERNATIONAL VARCHAR2(12 CHAR) NOT NULL,
                             GATTUNG_NATIONAL VARCHAR2(3 CHAR) NOT NULL,
                             STARTDATE DATE,
                             ENDDATE DATE,
                             CLUSTERNUMBER VARCHAR2(7 CHAR) NOT NULL,
                             CLASSIFIABLE NUMBER(1),
                             POSITIONINBITARRAY NUMBER(19,0) NOT NULL,
                             SPECIAL NUMBER(1),
                             RATING NUMBER(1),
                             IS_RECENTLY_IMPORTED NUMBER(1) NOT NULL,
                             WVB_ID NUMBER(19,0) NOT NULL,
                             CONSTRAINT KLEINSTESCLUSTER_PK PRIMARY KEY (ID)
                             USING INDEX TABLESPACE INDX   
                             )
  TABLESPACE DATA
  ;

CREATE TABLE EWDS_OWNER.WAGEN (
   ID  NUMBER(19,0) NOT NULL,
   VERSION  NUMBER(19,0),
   IS_RECENTLY_IMPORTED NUMBER(1) NOT NULL,
   WAGENUNUMBER NUMBER(19,0) NOT NULL,
   KLEINSTESCLUSTER_ID NUMBER(19,0),   
   CONSTRAINT WAGEN_PK PRIMARY KEY (ID)
            USING INDEX
            TABLESPACE INDX
   )
  TABLESPACE DATA
  ;
 
CREATE TABLE EWDS_OWNER.WVB (
   ID  NUMBER(19,0) NOT NULL,
   VERSION  NUMBER(19,0),
   NAME VARCHAR2(70 CHAR),
   BAHNVERWALTUNGSNUMMER VARCHAR2(6 CHAR) NOT NULL,
   PARTNERID VARCHAR2(8 CHAR) NOT NULL,
   UNTERNEHMENSCODE VARCHAR2(4 CHAR) NOT NULL,   
   IS_RECENTLY_IMPORTED NUMBER(1) NOT NULL,
   CONSTRAINT WVB_PK PRIMARY KEY (ID)
   USING INDEX
            TABLESPACE INDX
    )
  TABLESPACE DATA
  ;   




Whenwver I try to call flush on the entityManager, I get the following error:

Code:
testFindKcByImportedFlag(de.db.ewds.stammdaten.kleinstecluster.dataaccess.KleinstesClusterDataAccessTest)  Time elapsed: 0.105 sec  <<< ERROR!
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
   at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
   at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:307)
   at de.db.ewds.stammdaten.kleinstecluster.dataaccess.KleinstesClusterDataAccessTest.testFindKcByImportedFlag(KleinstesClusterDataAccessTest.java:32)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
   at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
   at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
   at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
   at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
   at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
   at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)
Caused by: org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
   at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:276)
   at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:115)
   at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:110)
   at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:245)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2243)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2679)
   at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
   at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1029)
   at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:304)
   at de.db.ewds.stammdaten.kleinstecluster.dataaccess.KleinstesClusterDataAccessTest.testFindKcByImportedFlag(KleinstesClusterDataAccessTest.java:32)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
   at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
   at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
   at mockit.integration.junit4.internal.BlockJUnit4ClassRunnerDecorator.executeTest(BlockJUnit4ClassRunnerDecorator.java:126)
   at mockit.integration.junit4.internal.BlockJUnit4ClassRunnerDecorator.invokeExplosively(BlockJUnit4ClassRunnerDecorator.java:104)
   at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java)
   at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
   at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
   at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
   at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
   at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
   at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
   at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
   at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   ... 6 more
Caused by: java.sql.BatchUpdateException: ORA-00932: Inkonsistente Datentypen: NUMBER erwartet, BINARY erhalten

   at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10296)
   at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:216)
   at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
   at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:269)
   ... 49 more


I assume this is becuase Hibernate tries to make data of type binary instead of Number(1,0) as in the database, but whatever I tried I could not make it work.

Any ideas?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.