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: My hbm.xml file:
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;}
& 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">
try following your claim: If you do not specify a field, you do not need SELECT.
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; }
Comments
Post a Comment