I'm getting the following exception:
org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: org.postgresql.util.PSQLException: ERREUR: constante non entière dans ORDER BY
Position: 222
i have a mehode in my GareDAOIpml to show all the rows from the database,my methode show() is:
public List<Gare> show(int startIndex, int pageSize, String jtSorting) {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
List<Gare> gares = null;
try {
Query q = session.createQuery("from Gare ORDER BY "+jtSorting+" ");
q.setFirstResult(startIndex);
q.setMaxResults(pageSize);
gares = (List<Gare>)q.list();
} catch (HibernateException e) {
e.printStackTrace();
session.getTransaction().rollback();
}
session.getTransaction().commit();
return gares;
}
<script type="text/javascript">
$(document).ready(function() {
$('#StudentTableContainer').jtable({
title : 'liste des gares',
paging: true,
pageSize: 10,
sorting: false,
actions : {
listAction : 'listergare',
updateAction: 'updategare',
deleteAction: 'deletegare'
},
fields : {
idgare : {
title : 'identifiant de la gare',
key : true,
list : false,
edit : false
},
usergare : {
title : 'utilisateur de la gare',
width : '25%',
list : true,
edit : true
},
ville : {
title : 'ville ',
width : '25%',
type: 'date',
list : true,
edit : true
}
}
});
$('#StudentTableContainer').jtable('load');
});