Created
October 27, 2018 20:21
-
-
Save dmitry-osin/a833987864de661c74b7564c6f0aa661 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pw.osin.example.model; | |
import javax.persistence.*; | |
@NamedQueries({ | |
@NamedQuery(name = Tweet.FIND_BY_QUERY, query = "SELECT tweet FROM Tweet tweet WHERE LOWER(tweet.text) LIKE CONCAT('%', LOWER(:query) , '%')") | |
}) | |
@Entity | |
public class Tweet { | |
public static final String FIND_BY_QUERY = "Tweet.FIND_BY_QUERY"; | |
@Id | |
@GeneratedValue | |
private Long id; | |
private String text; | |
private String user; | |
// ** getters & setters | |
// equals & hash code | |
// toString | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment