掲示板
using native SQL
hi everyone,
I want tp use native SQL but even a simple query did not work and I got an exception
here is the Query:
here is the exception:
thanks in advance.
I want tp use native SQL but even a simple query did not work and I got an exception
here is the Query:
session.createSQLQuery("SELECT * FROM Book").addEntity(Book.class).list();
here is the exception:
org.hibernate.MappingException: Unknown entity: com.ext.portlet.library.model.Book
thanks in advance.
hi,
I can use native SQL directly in my JAVA class right?
it is not necessary to define my queries in xml files like what is shown in this article:
custom query
right??
thanks.
I can use native SQL directly in my JAVA class right?
it is not necessary to define my queries in xml files like what is shown in this article:
custom query
right??
thanks.
You cant use native sql directly in your java class.
hibernate session wont be available there. You should follow the same link for custom query, you have posted.
hibernate session wont be available there. You should follow the same link for custom query, you have posted.
11年前 に Hitoshi Ozawa によって更新されました。
RE: using native SQL
Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
Is there some reason to why you would want to use sql directly? Liferay sometimes changes fields and interfaces and writing sql directly would make maintenance more difficult.