Reputation: 69
EntityManager em;
em = this.getEntityManager();
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery<Date> criteria = builder.createQuery(Date.class);
Root<News> newsRoot = criteria.from(News.class);
criteria.select(newsRoot.get(News_.date)).distinct(true);
List<Date> newsList = em.createQuery(criteria).getResultList();
return newsList;
The News_.date is not working I don't know why but in other project it's working.
The error is I need to create a class for News_. but before it's working .
Someone encounter this problem?
Upvotes: 0
Views: 310
Reputation: 69
I have already solved my problem
In AppData and select NetBeans/. metadata - there is a blank .txt file. This file blocks your classes. So When I delete it. I can now access the classes.
Upvotes: 1