org.hibernate.MappingException: нет сопоставления диалектов для типа JDB C: 1111, пакетная пружина - PullRequest
0 голосов
/ 20 января 2020

Я использую Spring Batch и postgresql, и я пытаюсь извинить код ниже:

 private Query buildQuery4SearchValoLoc(Societe societe, ParamSociete paramSoc)
  {
    Session session = getSession(); 
    SessionFactoryImpl sessionFactory = (SessionFactoryImpl)session.getSessionFactory();
    String schemaName = sessionFactory.getSettings().getDefaultSchemaName(); 
    String sql="select "
            + " ('0'|| soc.code_eds) as COMPANY_ID, "
            + "(edsR.code_eds || '-0' || soc.code_eds) as PROJECT_ID, "
            + "1 as SUB_PROJECT_ID,"
            + "1 as ACTIVITY_NO,"
            + "ch.id_activite as ACTIVITY_SEQ,"
            + "'YMIN' as EMP_NO,"
            + "'YMINDV' as REPORT_COST_CODE, " 
            + "  (case when (v.montant_valorise* (-1))<=0 then -1 else 1 end) as INTERNAL_PRICE_DB, "
            + "v.montant_valorise as INTERNAL_AMOUNT,"
            + "null as INVOICABILITY_DB,"
            + "null as COST_ACCOUNTING,"
            +" ('PHAROS_' || (v.annee*100)+ v.mois || '_' || v.type_ligne_valorisation) as 
  INTERNAL_COMMENTS,"
            + "(edsm.code_edsm || '_'|| edsm.lib_edsm ) as INVOICE_COMMENTS "
            + " from "
            +schemaName+ ".valorisation_location v"
            + " inner join "+schemaName+".eds  soc"
            + " on v.societe=soc.id_eds"
            + " inner join "+schemaName+".chantier  ch on v.compte_de_recette=ch.id_eds "
            + " inner join "+schemaName+".edsm on v.id_edsm=edsm.id_edsm"
            + " inner join "+schemaName+".eds  edsR on v.compte_de_recette=edsR.id_eds" 
            + " where v.montant_facture !=0 and v.statut_traitment like 'F' "
        + "and v.societe = "+societe.getId();
    Query query = session.createSQLQuery(sql);

    return query;
  }

    public List<String> getValorisationLocation(Societe societe,ParamSociete paramSociete) throws 
 TechnicalNGEException {

    List<String> result = null;
    try {
        Query query = this.buildQuery4SearchValoLoc(societe ,paramSociete);
        result = (List<String>) query.list();

    } catch (HibernateException e) {
        bloqException(e);
    }

    return result;
}

, но я получаю эту ошибку:

Причина: org.hibernate. MappingException: нет сопоставления диалектов для типа JDB C: 1111 в org.hibernate.dialect.TypeNames.get (TypeNames. java: 76) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final ] в org.hibernate.dialect.TypeNames.get (TypeNames. java: 99) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org.hibernate.dialect.Dialect.getHibernateTypeName ( Dialect. java: 592) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org.hibernate.loader.custom.CustomLoader $ Metadata.getHibernateType (CustomLoader. java: 696) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org.hibernate.loader.custom.CustomLoader $ ScalarResultColumnProcessor.performDiscovery (CustomLoader. java: 600) [hibernate-core-4.2.7 .Final.jar: 4.2.7.Final] at org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes (CustomLoader. java: 616) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final ] на org.hibernate.loader .Loader.getResultSet (Loader. java: 2048) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org.hibernate.loader.Loader.executeQueryStatement (Loader. java: 1837 ) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org.hibernate.loader.Loader.executeQueryStatement (Loader. java: 1816) [hibernate-core-4.2.7.Final. jar: 4.2.7.Final] в org.hibernate.loader.Loader.doQuery (Loader. java: 900) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org.hibernate .loader.Loader.doQueryAndInitializeNonLazyCollections (Loader. java: 342) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org.hibernate.loader.Loader.doList (Loader. java : 2526) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org.hibernate.loader.Loader.doList (Loader. java: 2512) [hibernate-core-4.2.7. Final.jar: 4.2.7.Final] в org.hibernate.loader.Loader.listIgnoreQueryCache (Loader. java: 2342) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org .hibernate.loader.Loader.list (Loader. java: 2337) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org.hibernate. loader.custom.CustomLoader.list (CustomLoader. java: 338) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org.hibernate.internal.SessionImpl.listCustomQuery (SessionImpl. * 1025) *: 1833) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в org.hibernate.internal.AbstractSessionImpl.list (AbstractSessionImpl. java: 231) [hibernate-core-4.2.7 .Final.jar: 4.2.7.Final] в org.hibernate.internal.SQLQueryImpl.list (SQLQueryImpl. java: 157) [hibernate-core-4.2.7.Final.jar: 4.2.7.Final] в com.nge.sigma.dao.impl.ValorisationLocationDAO.getValorisationLocation (ValorisationLocationDAO. java: 1316) [sigma-dao-0.0.14-SNAPSHOT.jar:] ... еще 63

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...