I was trying to collect data from table ProductInformation
using parameters ProductId
with following code but all I get is
unexpected token: * near line 1, column 8 [select * from com.koshayali.Koshayalinepal.model.ProductInformation where ProductId = :ProductId]
Code:
@Override
@Transactional
public List<ProductInformation> getSearchId(String ProductId) {
Session session=sessionFactory.openSession();
String sql = "select * from ProductInformation where ProductId = :ProductId";
Query query = session.createQuery(sql).setParameter("ProductId", ProductId);;
List<ProductInformation> produ = query.list();
session.close();
return produ;
}