You needed to pass the parameters as String and Integer. The Hibernate logs this way on both cases: [BasicBinder:83]: binding parameter [1] as [INTEGER] - 1 [BasicBinder:83]: binding parameter [2] as [VARCHAR] - WELCOME.
Not sure if your parameters MessageTemplate messageTemplate plays well with template.message_type = ?1, have you tried to pass String messageTemplate, I mean conversion between the messageTemplate and String needed in the query, try to add DEBUG to see the parameters send to the database
UPDATE And the end parameters in the method should be string and int, not the Classes.