Skip to content

Tag: hibernate

JPA @Column annotation to create comment/description

I was wondering is it possible to create from jpa/hibernate annotation a database column description/comment like this: ALTER TABLE tablename CHANGE status status INT(11) NOT NULL COMMENT ‘sample description/comment’; It will be great functionality, but I cant find anything about this in JPA speci…

How to count number of rows using JPA?

I try to count number of rows using JPA.I want to use where clause however I can’t. How can I set where clause forexample where age=”45″. Thanks in advance. Answer Use ParameterExpression. Note: Untested. Reference.

No Dialect mapping for JDBC type: 1111

I’m working on a Spring JPA Application, using MySQL as database. I ensured that all spring-jpa libraries, hibernate and mysql-connector-java is loaded. I’m running a mysql 5 instance. Here is a excerpt of my application.properties file: When executing an integration test, spring startsup properly…

MySQL to Hibernate datatype mapping for type “YEAR”

There’s a column in our database which needs to be of type YEAR. What is the corresponding Hibernate mapping for the entity? Tried searching all over, but unable to find the details. I am not sure if I need to use anything from @Temporal or any other specific type. We are using Hibernate ORM v4.1.7. Ans…