Hibernate-sequence doesn’t exist

It will look for how the database that you are using generates ids. For MySql or HSQSL, there are increment fields that automatically increment. In Postgres or Oracle, they use sequence tables. Since you didn’t specify a sequence table name, it will look for a sequence table named hibernate_sequence and use it for default. So you probably don’t have such a sequence table in your database and now you get that error.

Either add a hibernate_sequence or
your own sequence table and use the annotations to name your sequence table that you have.


ERROR: operator does not exist: integer ~~ unknown

yourCriteriaObj.add(Restrictions.sqlRestriction(" sequenceNo LIKE '%"+yourSequenceNumToSearch+"%' "));

return error for unabling type cast:

operator does not exit : integer ~~ unknown HINT: No operator matches the given name and argument tyeps(s). you might need to add explicitr type casts.

so, we can use this code:

yourCriteriaObj.add(Restrictions.sqlRestriction(" sequenceNo ::text LIKE '%"+yourSequenceNumToSearch+"%' "));

How to get next 12 month and year list from current date in java

in bellow example if nextMonthCount=0 and endMonthCount=12

then it will create January to December month with year (Separater ‘-‘ )

1.calculateMonthYear method


public Set<String> calculateMonthYear(Date date, int nextMonthCount, int endMonthCount) {

log.info(“RetailProductionPlanBean.calculateMonthYear Method Started”);

DateFormat formater = new SimpleDateFormat(“dd-MMMM-yyyy”);

Date nextMonth = AppUtil.addOrMinusMonth(date, nextMonthCount);

String nextMonthStr = formater.format(nextMonth);

Date endMonth = AppUtil.addOrMinusMonth(nextMonth, endMonthCount);

String endMonthStr = formater.format(endMonth);

Set<String> monthYearList = new LinkedHashSet<String>();

Calendar beginCalendar = Calendar.getInstance();

Calendar finishCalendar = Calendar.getInstance();

try { beginCalendar.setTime(formater.parse(nextMonthStr)); finishCalendar.setTime(formater.parse(endMonthStr));

} catch (ParseException e) {

log.error(“Error in calculateMonthYear”,e);

} while (beginCalendar.before(finishCalendar)) {

String dateStr = formater.format(beginCalendar.getTime()); beginCalendar.add(Calendar.MONTH, 1);

String[] arr =dateStr.split(“-“);



return monthYearList;



2.addOrMinusMonth method


public  Date addOrMinusMonth(Date date,int noOfMonth) {

Calendar cal = Calendar.getInstance();


cal.add(Calendar.MONTH, noOfMonth);

return cal.getTime(); }