Could Not Extract Resultset in Hibernate

could not extract ResultSet in hibernate

The @JoinColumn annotation specifies the name of the column being used as the foreign key on the targeted entity.

On the Product class above, the name of the join column is set to ID_CATALOG.

@ManyToOne
@JoinColumn(name="ID_CATALOG")
private Catalog catalog;

However, the foreign key on the Product table is called catalog_id

`catalog_id` int(11) DEFAULT NULL,

You'll need to change either the column name on the table or the name you're using in the @JoinColumn so that they match. See http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html/entity.html#entity-mapping-association

Could not extract ResultSet when @Formula (hibernate annotation) is used

This is my solution that works !

@Formula("SELECT AVG(cr.rating) FROM course_ratings cr WHERE cr.course_id = course_id")

I've changed courseId to course_id because it's a raw SQL, not JPQL

Relation XX does not exist; could not extract Resultset error while using a view convertHibernateAccessException

Probably the table/view is in a different schema? Or maybe the user for the JDBC connection has no permission to read from that table/view?



Related Topics



Leave a reply



Submit