Try something like:
@Column(name="POSTS_REF")
@Where(clause="state="PostPublished"")
private List<Posts> userPosts;
or
@Column(name="POSTS_REF")
@Where(clause="PostPublished=true")
private List<Posts> userPosts;
depending on the status field type on your Post
entity.
More Related Contents:
- Mapping many-to-many association table with extra column(s)
- How to generate Custom Id using hibernate while it must be primary key of table
- How does JPA orphanRemoval=true differ from the ON DELETE CASCADE DML clause
- JPA 2.0 many-to-many with extra column
- How to mix inheritance strategies with JPA annotations and Hibernate?
- Does the JPA specification allow references to non-primary key columns?
- Hibernate: comparing current & previous record
- Struggling to understand EntityManager proper use
- Hibernate problem – “Use of @OneToMany or @ManyToMany targeting an unmapped class”
- How to use the Java 8 LocalDateTime with JPA and Hibernate
- JPQL Constructor Expression – org.hibernate.hql.ast.QuerySyntaxException:Table is not mapped
- Hibernate throws org.hibernate.AnnotationException: No identifier specified for entity: com..domain.idea.MAE_MFEView
- What is referencedColumnName used for in JPA?
- Using JPA entities in JSF. Which is the best strategy to prevent LazyInitializationException?
- JPA/Hibernate remove entity sometimes not working
- Hibernate: How specify custom sequence generator class name using annotations?
- How to configure Spring to make JPA (Hibernate) and JDBC (JdbcTemplate or MyBatis) share the same transaction
- Deleted object would be re-saved by cascade (remove deleted object from associations)
- Invalidating JPA EntityManager session
- Hibernate ID Generator
- JPA Uppercase table names
- what is the right path to refer a jar file in jpa persistence.xml in a web app?
- JPA CriteriaBuilder – How to use “IN” comparison operator
- Hibernate/JPA ManyToOne vs OneToMany
- inverse=true in JPA annotations
- Persist java.time.Instant (JDK8) with JPA2/Hibernate
- In Spring with jpa/hibernate, how do I keep a session open to avoid lazy initialization exceptions?
- Should Hibernate be able to handle overlapping foreign keys?
- createEntityManager throws java.lang.NullPointerException at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus
- New object with HQL