/** * Test candidate for {@link MappedSuperclass}. * * @author Stephane Nicoll */ @MappedSuperclass public abstract class SampleMappedSuperClass { }
/** * @author Strong Liu <stliu@hibernate.org> */ @MappedSuperclass abstract class VersionedRecord implements java.io.Serializable { Long recordVersion; Boolean isDeleted; }
@MappedSuperclass public abstract static class DatabaseEntity { private int id; @Id @GeneratedValue public int getId() { return id; } public void setId(int id) { this.id = id; } }
/** * @author Emmanuel Bernard */ @MappedSuperclass public class Competition { }
@MappedSuperclass public abstract static class BaseDocumentLine extends AbstractEntity { private String text; @Column(name = "textValue", nullable = false) public String getText() { return text; } public void setText(String text) { this.text = text; } }
/** * @author Emmanuel Bernard */ @MappedSuperclass public class PricedStuff extends Stuff<Price> { }
@MappedSuperclass public abstract static class Person { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } public abstract void setId(Long id); public abstract City getCity(); public abstract void setCity(City city); }
@MappedSuperclass public abstract static class AbstractMappedSuperclass { @Id private String categoryId; public String getCategoryId() { return categoryId; } public void setCategoryId(String categoryId) { this.categoryId = categoryId; } }
/** * @author Hardy Ferentschik */ @javax.persistence.MappedSuperclass public class MappedSuperclass { @Id private long id; }
@MappedSuperclass public class Base { @Id protected String uuid; }
/** * @author Emmanuel Bernard */ @MappedSuperclass public class Interaction { @Column(name="int_nbr") public int number; }
@MappedSuperclass public static abstract class AbstractEventsEntityModel { @ManyToMany(fetch = FetchType.LAZY ) private List<LocalDateEvent> events = new ArrayList<>( ); public List<LocalDateEvent> getEvents() { return events; } }
/** * @author Hardy Ferentschik */ @MappedSuperclass public class Product { @ManyToOne Shop shop; }
/** * @author Hardy Ferentschik */ @Embeddable @MappedSuperclass public class EmbeddableAndMappedSuperClass { }
@MappedSuperclass public abstract class AttachmentGroup<GroupType extends AttachmentGroup, PostType extends AttachmentGroupPost<UserRoleType, GroupType>, UserRoleType extends UserRole> { @OneToMany(mappedBy = "parentGroup") protected Set<PostType> posts; @Id long id; }
@MappedSuperclass public abstract class AbstractEntity<T> { @Id @GeneratedValue private Long id; private T foo; public AbstractEntity() { } }
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @MappedSuperclass public static class Employee { @Id @GeneratedValue private Long id; private String jobType; private String firstName; private String lastName; }
/** * @author Emmanuel Bernard */ @MappedSuperclass @IdClass(Location.class) public class MilitaryBuilding { @Id public double longitude; @Id public double latitude; }
@org.hibernate.annotations.NamedQuery( name = "night.olderThan", query = "select n from Night n where n.date <= :date" ) @MappedSuperclass public class Darkness { }
@MappedSuperclass @Inheritance( strategy = InheritanceType.SINGLE_TABLE ) @DiscriminatorColumn( name = "type", discriminatorType = DiscriminatorType.STRING ) private static abstract class Item { @Id @GeneratedValue Long id; @ManyToOne( fetch = FetchType.LAZY ) Author author; }