org.hibernate.annotations.Entity类的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(301)

本文整理了Java中org.hibernate.annotations.Entity类的一些代码示例,展示了Entity类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity类的具体详情如下:
包路径:org.hibernate.annotations.Entity
类名称:Entity

Entity介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-orm

/**
 * @author Emmanuel Bernard
 */
@Entity
@Table(name = "sport_car")
@org.hibernate.annotations.Entity(polymorphism = PolymorphismType.EXPLICIT) //raise a warn
public class SportCar extends Car {
}

代码示例来源:origin: hibernate/hibernate-orm

? ( hibAnn == null ? false : hibAnn.dynamicInsert() )
: dynamicInsertAnn.value();
? ( hibAnn == null ? false : hibAnn.dynamicUpdate() )
: dynamicUpdateAnn.value();
? ( hibAnn == null ? false : hibAnn.selectBeforeUpdate() )
: selectBeforeUpdateAnn.value();
? ( hibAnn == null ? OptimisticLockType.VERSION : hibAnn.optimisticLock() )
: optimisticLockingAnn.type();
? ( hibAnn == null ? PolymorphismType.IMPLICIT : hibAnn.polymorphism() )
: polymorphismAnn.type();

代码示例来源:origin: hibernate/hibernate-orm

annotatedClass.getAnnotation( org.hibernate.annotations.Entity.class );
  if ( entityAnn != null ) {
    mutable = entityAnn.mutable();
if ( entityAnn != null && !BinderHelper.isEmptyAnnotationValue( entityAnn.persister() ) ) {
  try {
    persister = context.getBootstrapContext().getClassLoaderAccess().classForName( entityAnn.persister() );
    throw new AnnotationException( "Could not find persister class: " + entityAnn.persister(), e );

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

private void bindHibernateAnnotation(org.hibernate.annotations.Entity hibAnn) {
  if ( hibAnn != null ) {
    dynamicInsert = hibAnn.dynamicInsert();
    dynamicUpdate = hibAnn.dynamicUpdate();
    mutable = hibAnn.mutable();
    optimisticLockType = hibAnn.optimisticLock();
    persister = hibAnn.persister();
    selectBeforeUpdate = hibAnn.selectBeforeUpdate();
    polymorphismType = hibAnn.polymorphism();
    explicitHibernateEntityAnnotation = true;
  }
  else {
    //default values when the annotation is not there
    dynamicInsert = false;
    dynamicUpdate = false;
    mutable = true;
    optimisticLockType = OptimisticLockType.VERSION;
    persister = "";
    polymorphismType = PolymorphismType.IMPLICIT;
    selectBeforeUpdate = false;
  }
}

代码示例来源:origin: hibernate/hibernate-orm

/**
 * @author Hardy Ferentschik
 */
@Entity
public class Boy {
  @Id
  @GeneratedValue
  private long id;

  private Set<String> nickNames;

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public Set<String> getNickNames() {
    return nickNames;
  }

  public void setNickNames(Set<String> nickNames) {
    this.nickNames = nickNames;
  }
}

代码示例来源:origin: org.hibernate/hibernate-annotations

private void bindHibernateAnnotation(org.hibernate.annotations.Entity hibAnn) {
  if ( hibAnn != null ) {
    dynamicInsert = hibAnn.dynamicInsert();
    dynamicUpdate = hibAnn.dynamicUpdate();
    optimisticLockType = hibAnn.optimisticLock();
    selectBeforeUpdate = hibAnn.selectBeforeUpdate();
    polymorphismType = hibAnn.polymorphism();
    explicitHibernateEntityAnnotation = true;
    //persister handled in bind
  }
  else {
    //default values when the annotation is not there
    dynamicInsert = false;
    dynamicUpdate = false;
    optimisticLockType = OptimisticLockType.VERSION;
    polymorphismType = PolymorphismType.IMPLICIT;
    selectBeforeUpdate = false;
  }
}

代码示例来源:origin: org.hibernate/hibernate-annotations

annotatedClass.getAnnotation( org.hibernate.annotations.Entity.class );
  if ( entityAnn != null ) {
    mutable = entityAnn.mutable();
if ( entityAnn != null && !BinderHelper.isDefault( entityAnn.persister() ) ) {
  try {
    persister = ReflectHelper.classForName( entityAnn.persister() );

代码示例来源:origin: hibernate/hibernate-orm

/**
 * @author Hardy Ferentschik
 */
@Entity
public class MedicalHistory {
  @Id
  @OneToOne
  @JoinColumn(name="FK")
  Person patient;

  @Lob
  byte[] xrayData;

  private MedicalHistory() {
  }

  public MedicalHistory(Person patient) {
    this.patient = patient;
  }

  public byte[] getXrayData() {
    return xrayData;
  }

  public void setXrayData(byte[] xrayData) {
    this.xrayData = xrayData;
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private void bindHibernateAnnotation(org.hibernate.annotations.Entity hibAnn) {
  if ( hibAnn != null ) {
    dynamicInsert = hibAnn.dynamicInsert();
    dynamicUpdate = hibAnn.dynamicUpdate();
    optimisticLockType = hibAnn.optimisticLock();
    selectBeforeUpdate = hibAnn.selectBeforeUpdate();
    polymorphismType = hibAnn.polymorphism();
    explicitHibernateEntityAnnotation = true;
    //persister handled in bind
  }
  else {
    //default values when the annotation is not there
    dynamicInsert = false;
    dynamicUpdate = false;
    optimisticLockType = OptimisticLockType.VERSION;
    polymorphismType = PolymorphismType.IMPLICIT;
    selectBeforeUpdate = false;
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

annotatedClass.getAnnotation( org.hibernate.annotations.Entity.class );
  if ( entityAnn != null ) {
    mutable = entityAnn.mutable();
if ( entityAnn != null && !BinderHelper.isEmptyAnnotationValue( entityAnn.persister() ) ) {
  try {
    persister = ReflectHelper.classForName( entityAnn.persister() );

代码示例来源:origin: hibernate/hibernate-orm

/**
 * @author Shawn Clowater
 */
@Entity
@org.hibernate.annotations.Entity( persister = "org.hibernate.persister.entity.SingleTableEntityPersister" )
@Persister( impl = org.hibernate.test.annotations.persister.EntityPersister.class )
public class Deck implements Serializable {
  @Id
  public Integer id;

  @OneToMany( mappedBy = "deck" )
  @Persister( impl = org.hibernate.test.annotations.persister.CollectionPersister.class )
  public Set<Card> cards;
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

private void bindHibernateAnnotation(org.hibernate.annotations.Entity hibAnn) {
  if ( hibAnn != null ) {
    dynamicInsert = hibAnn.dynamicInsert();
    dynamicUpdate = hibAnn.dynamicUpdate();
    optimisticLockType = hibAnn.optimisticLock();
    selectBeforeUpdate = hibAnn.selectBeforeUpdate();
    polymorphismType = hibAnn.polymorphism();
    explicitHibernateEntityAnnotation = true;
    //persister handled in bind
  }
  else {
    //default values when the annotation is not there
    dynamicInsert = false;
    dynamicUpdate = false;
    optimisticLockType = OptimisticLockType.VERSION;
    polymorphismType = PolymorphismType.IMPLICIT;
    selectBeforeUpdate = false;
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

annotatedClass.getAnnotation( org.hibernate.annotations.Entity.class );
  if ( entityAnn != null ) {
    mutable = entityAnn.mutable();
if ( entityAnn != null && !BinderHelper.isEmptyAnnotationValue( entityAnn.persister() ) ) {
  try {
    persister = ReflectHelper.classForName( entityAnn.persister() );

代码示例来源:origin: hibernate/hibernate-orm

@org.hibernate.annotations.Entity(polymorphism = PolymorphismType.EXPLICIT)
public class Car extends Automobile {

代码示例来源:origin: org.hibernate.orm/hibernate-core

? ( hibAnn == null ? false : hibAnn.dynamicInsert() )
: dynamicInsertAnn.value();
? ( hibAnn == null ? false : hibAnn.dynamicUpdate() )
: dynamicUpdateAnn.value();
? ( hibAnn == null ? false : hibAnn.selectBeforeUpdate() )
: selectBeforeUpdateAnn.value();
? ( hibAnn == null ? OptimisticLockType.VERSION : hibAnn.optimisticLock() )
: optimisticLockingAnn.type();
? ( hibAnn == null ? PolymorphismType.IMPLICIT : hibAnn.polymorphism() )
: polymorphismAnn.type();

代码示例来源:origin: org.hibernate.orm/hibernate-core

annotatedClass.getAnnotation( org.hibernate.annotations.Entity.class );
  if ( entityAnn != null ) {
    mutable = entityAnn.mutable();
if ( entityAnn != null && !BinderHelper.isEmptyAnnotationValue( entityAnn.persister() ) ) {
  try {
    persister = context.getBootstrapContext().getClassLoaderAccess().classForName( entityAnn.persister() );
    throw new AnnotationException( "Could not find persister class: " + entityAnn.persister(), e );

代码示例来源:origin: hibernate/hibernate-orm

@org.hibernate.annotations.Entity(
    selectBeforeUpdate = true,
    dynamicInsert = true, dynamicUpdate = true,

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

@org.hibernate.annotations.Entity(dynamicUpdate = true, dynamicInsert = true)
@EntityListeners(value = {AuditableEventListener.class})
public abstract class AbstractAuditable implements Auditable {

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

@org.hibernate.annotations.Entity(dynamicUpdate = true, dynamicInsert = true)
@EntityListeners(value = {AuditableEventListener.class})
public abstract class AbstractAuditable implements Auditable {

代码示例来源:origin: OneBusAway/onebusaway-application-modules

@Index(name = "tr_id_idx", columnNames = {"id"}),
  @Index(name = "tr_alert_id_idx", columnNames = {"alert_id"})})
@org.hibernate.annotations.Entity(mutable = false)
public class TimeRangeModel {

相关文章