javax.persistence.Access.<init>()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(65)

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

Access.<init>介绍

暂无

代码示例

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

@Entity
@Access(AccessType.FIELD)
public class SubA extends NormalExtendsEntity {
  protected String street;

  public String getStreet() {
    return street;
  }
}

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

@Entity
@Access(AccessType.FIELD)
public class SubB extends NormalExtendsMapped {
  protected String street;

  public String getStreet() {
    return street;
  }
}

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

/**
 * @author Hardy Ferentschik
 */
@Entity
@Access(AccessType.FIELD)
public class Animal {

  private long id;

  @Access( AccessType.PROPERTY)
  @Id
  @GeneratedValue
  public long getId() {
    return id;
  }

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

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

/**
 * @author Emmanuel Bernard
 */
@Entity
public class Customer extends User {
  private Set<Order> orders;
  private String nonPersistent;

  @Access(AccessType.FIELD)
  boolean goodPayer;

  public Set<Order> getOrders() {
    return orders;
  }

  @OneToMany
  public void setOrders(Set<Order> orders) {
    this.orders = orders;
  }
}

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

/**
 * @author Emmanuel Bernard
 */
@Entity
@Access(javax.persistence.AccessType.FIELD)
public class Hominidae extends Mammals {
  private int intelligence;

  public int getIntelligence() {
    return intelligence;
  }

  public void setIntelligence(int intelligence) {
    this.intelligence = intelligence;
  }

  public int getNonPersistent() {
    return 0;
  }
}

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

@Entity(name = "Address")
@Table(name = "ADDRESS")
@Access(AccessType.FIELD)
public static class Address {
  @Id
  @Column(name = "ID", nullable = false)
  @SequenceGenerator(name = "ID", sequenceName = "ADDRESS_SEQ")
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ID")
  private Long id;
}

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

@Entity
  @Access( AccessType.FIELD )
  @Table( name = "LAZY_PROPERTY_ENTITY" )
  private static class LazyEntity {

    @Id
    @GeneratedValue
    Long id;

    @Basic( fetch = FetchType.LAZY )
    String description;
  }
}

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

@Entity(name = "Address")
@Table(name = "ADDRESS")
@Access(AccessType.FIELD)
public static class Address {
  @Id
  @Column(name = "ID", nullable = false)
  @SequenceGenerator(name = "ID", sequenceName = "ADDRESS_SEQ")
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ID")
  private Long id;
}

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

@Entity
@Access(AccessType.PROPERTY)
public class Root {
  private Long id;

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

@Entity(name = "SpecialPerson")
  @Access(AccessType.FIELD)
  @DiscriminatorValue("2")
  public static class SpecialPerson extends Person {
    @Column(name = "special")
    private String special;
  }
}

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

@Entity(name = "SpecialPerson")
  @Access(AccessType.FIELD)
  @DiscriminatorValue("2")
  public static class SpecialPerson extends Person {
    @Column(name = "special")
    private String special;
  }
}

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

@Entity
@Access(javax.persistence.AccessType.PROPERTY)
public class Gardenshed
    extends

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

@Entity(name = "Book")
public static class Book {
  private Long id;
  private String title;
  private String author;
  @Access( AccessType.FIELD )
  @Version
  private int version;
  @Id
  public Long getId() {
    return id;
  }
  public void setId(Long id) {
    this.id = id;
  }
  public String getTitle() {
    return title;
  }
  public void setTitle(String title) {
    this.title = title;
  }
  public String getAuthor() {
    return author;
  }
  public void setAuthor(String author) {
    this.author = author;
  }
}
//end::access-property-override-mapping-example[]

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

@Entity
@Access(AccessType.FIELD)
public class BaseEntity {
  @Id
  @SequenceGenerator(name = "test1_id_gen", sequenceName = "test1_seq")
  @GeneratedValue(generator = "test1_id_gen", strategy = GenerationType.SEQUENCE)
  protected Integer id;

  protected String name;

  public BaseEntity() {
  }

  public Integer getId() {
    return id;
  }

  public String getName() {
    return name;
  }
}

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

@Entity
@Access(AccessType.PROPERTY)
public class Course4 {
  @Id

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

@Entity
  @Access(AccessType.PROPERTY)
  private Long id = null;

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

@Entity
@Access(AccessType.FIELD)
public class Leaf {
  @Id

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

@Entity
@Access(AccessType.FIELD)
public class Location {
  @Id

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

@Entity
@Access(AccessType.FIELD)
@Table(name = "SOMEOTHERENTITY")
public class SomeOtherEntity {

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

@Entity(name = "Person")
@Access(AccessType.FIELD)
@Table(name = "PERSON")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "CLASSINDICATOR", discriminatorType = DiscriminatorType.INTEGER)
@DiscriminatorValue("1")
public static class Person {
  @Id
  @Column(name = "ID", nullable = false)
  @SequenceGenerator(name = "ID_2", sequenceName = "PERSON_SEQ")
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ID_2")
  private Long id;
  @OneToMany(orphanRemoval = true, cascade = {
      CascadeType.PERSIST,
      CascadeType.REMOVE
  })
  @JoinColumn(name = "PERSONID", referencedColumnName = "ID", nullable = false, updatable = false)
  @BatchSize(size = 100)
  private Set<Address> addresses = new HashSet<Address>();
  public void addAddress(Address address) {
    this.addresses.add( address );
  }
}

相关文章

最新文章

更多