java - Error in my hibernate request -


Hello, I have an error when I execute a request with Hibernate

Error ast.ErrorCounter (ErrorCounter.java:33) - Line 01:22: Found the expectation of the president '*'

My claim:

  public rechercheValeurTarifs () Throws exception {list tarifs = null; . {Tarifs try = getHibernateTemplate get () ( "FE_TARIF_IDF * Choose." + "From" FE_TARIF_IDF + "Where FE_TARIF_IDF.D_ANNEE (Select Max (FE_EXERCICE_FISCAL.D_CEXER) from FE_EXERCICE_FISCAL);"); If (tarifs == zero) {tarifs = getHibernateTemplate () ( "SELECT FE_TARIF_IDF. *" + "FE_TARIF_IDF the" + "in the WHERE FE_TARIF_IDF.D_ANNEE (select MAX (FE_EXERCICE_FISCAL.D_CEXER-1) from FE_EXERCICE_FISCAL);";}} catch (Exception e) {System.out.println (e .getStackTrace ());} Return tarifs;}  

My hbm.xml file:

  & lt; XML version = "1.0" & gt; & LT; DOCTYPE hibernate-mapping public "- // hibernate / hibernate mapping DTD 3.0 // eN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> & Lt; hibernate-mapping package = "xx.xxx.xxx.persistance.bo" & gt; & Lt; class name = "Tarifs" table = "FE_TARIF_IDF" & gt; & Lt; cache usage = "read-write" / & gt; & Lt; Composite-id name = "idTarif" class = "idTarif">  & lt; / key-asset & gt; & lt; key-property Name = "zone" type = "int" length = "1" & gt; column name = "D_NZONE" />  gt; & lt; key-property name = " Type local "type =" string "length =" 1 "& gt; & Lt; Column name = "D_CTYPE_LOCAL" /> & Lt; / Key-asset & gt; & Lt; / Mixed-id & gt; & Lt; Property Name = "tarifNormal" type = "float" column = "D_NTARIF_NORMAL" length = "7" /> & Lt; Property Name = "Tariff Reduito" Type = "Float" column = "D_NTERIFUUUUT" length = "7" /> & Lt; Property name = "surfaceman" type = "float" column = "d_nsurfccman" length = "10" /> & Lt; / Square & gt; & Lt; / Hibernate-mapping & gt;  

itemprop = "text">

try following your claim:

  public List rechercheValeurTarifs () throws exception {list tarifs = null; Try {Tarifs = getHibernateTemplate (). ("From FE_TARIF_IDF" + "WHERE in FE_TARIF_IDF.D_ANNEE (SELECT MAX (FE_EXERCICE_FISCAL.D_CEXER) FE_EXERCICE_FISCAL);); If (tarifs == faucet) {tarifs = getHibernateTemplate () ( "The FE_TARIF_IDF" + "of the WHERE FE_TARIF_IDF.D_ANNEE (SELECT MAX (FE_EXERCICE_FISCAL.D_CEXER-1) FE_EXERCICE_FISCAL);"); }} Hold (exception e) {System.out.println (e.getStackTrace ()); } Return tarifs; }  

If you do not specify a field, you do not need SELECT.


Comments