Skip to content

Instantly share code, notes, and snippets.

@dmitry-osin
Created October 27, 2018 20:21
Show Gist options
  • Save dmitry-osin/a833987864de661c74b7564c6f0aa661 to your computer and use it in GitHub Desktop.
Save dmitry-osin/a833987864de661c74b7564c6f0aa661 to your computer and use it in GitHub Desktop.
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