Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- @Inheritance(strategy = InheritanceType.JOINED)
- @DiscriminatorColumn(name = "resourceType", discriminatorType = DiscriminatorType.INTEGER)
- public abstract class Resource {
- @Id
- @GeneratedValue(strategy = GenerationType.TABLE)
- Long id;
- String foo;
- }
- @MappedSuperclass
- public abstract class NetworkResource extends Resource {
- String bar;
- }
- @Entity
- @DiscriminatorValue(value = "1")
- public class URL extends NetworkResource {
- String url;
- }
- SELECT c FROM URL c LEFT JOIN c.resource r where r.resourceType = 1 and r.url = :ip
- select c from URL c where c.url = :ip
Add Comment
Please, Sign In to add comment