javax.persistence.Version类的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(199)

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

Version介绍

暂无

代码示例

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

@Entity
public class Partner {
  @Id
  @GeneratedValue
  private Long id;
  @Version
  private int version;

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

@Entity(name = "Person")
  public static class Person {

    @Id
    private Long id;

    private String name;

    @Version
    private long version;
  }
}

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

/**
 * @author Emmanuel Bernard
 */
@Entity
@Table(name = "matchtable", schema = "matchschema")
@SecondaryTable(name = "extendedMatch")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@NamedQueries({
@NamedQuery(name = "matchbyid", query = "select m from Match m where m.id = :id"),
@NamedQuery(name = "getAllMatches2", query = "select m from Match m")
    })
@NamedNativeQueries({
@NamedNativeQuery(name = "matchbyid", query = "select m from Match m where m.id = :id", resultSetMapping = "matchrs"),
@NamedNativeQuery(name = "getAllMatches2", query = "select m from Match m", resultSetMapping = "matchrs")
    })
public class Match extends Competition {
  public String competitor1Point;
  @Version
  public Integer version;
  public SocialSecurityNumber playerASSN;
}

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

@Version
@Column(name = "ver")
public Integer getVersion() {
  return version;
}

代码示例来源: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

@MappedSuperclass
private static class Person {
  @Id
  String name;
  @Version
  Long oca;
  Person(String name) {
    this.name = name;
  }
  Person() {
  }
  void setOca(long l) {
    this.oca = l;
  }
}

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

@Version
public int getVersion() {
  return version;
}

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

@Entity
private static abstract class Person {
  @Id
  String name;
  @Version
  long oca;
  Person() {
  }
  Person(String name) {
    this();
    this.name = name;
  }
  void setOca(long l) {
    this.oca = l;
  }
}

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

@Version
@Column(name = "ver")
public Integer getVersion() {
  return version;
}

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

@Version
public Integer getVersion() {
  return version;
}

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

@Entity( name = "thing" )
  @Table( name = "THING_ENTITY" )
  public class Thing {

    @Id
    @GeneratedValue( strategy = GenerationType.AUTO )
    long id;

    @Version
    long version;

    @Column( updatable = false )
    String special;
  }
}

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

@Entity(name = "Event")
public static class Book implements DomainModelEntity<Long> {
  @Id
  private Long id;
  @Version
  private Integer version;

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

@Version
@Column(name = "OPTLOCK")
public Integer getVersion() {
  return version;
}

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

@Version
public Integer getVersion() {
  return version;
}

代码示例来源:origin: spring-projects/spring-data-examples

@Entity
@Data
@RequiredArgsConstructor
public class Customer {
  private @GeneratedValue @Id Long id;
  private @Version Long version;
  private @JsonIgnore @LastModifiedDate LocalDateTime lastModifiedDate;

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

@Entity(name = "Data")
public static class Data {
  @Id
  private String id;
  @Version
  private Integer version;
  public String getId() {
    return id;
  }
  public void setId(String id) {
    this.id = id;
  }
  @ElementCollection(fetch = FetchType.LAZY)
  @MapKeyColumn(name = "key")
  private Map<String, GenericStringList> stringlist = new TreeMap<>();
}

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

@Version
@Column(nullable = false)
public Long getVersion() {
  return version;
}

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

@Version
public Integer getVersion() {
  return version;
}

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

@Entity(name = "Person")
@Inheritance(strategy = InheritanceType.JOINED)
public static class Person {
  @Id
  @Column(name = "PERSON_ID")
  private Long id;
  @Version
  @Column(name = "ver")
  private Integer version;
  private String name;
  public Person() {
  }
  public Person(Long id, String name) {
    this.id = id;
    this.name = name;
  }
}

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

@Entity(name = "Blog")
@Polymorphism(type = PolymorphismType.EXPLICIT)
public static class Blog implements DomainModelEntity<Long> {
  @Id
  private Long id;
  @Version
  private Integer version;
  private String site;
  //Getter and setters omitted for brevity
  //end::entity-inheritance-polymorphism-mapping-example[]
  @Override
  public Long getId() {
    return id;
  }
  public void setId(Long id) {
    this.id = id;
  }
  @Override
  public Integer getVersion() {
    return version;
  }
  public String getSite() {
    return site;
  }
  public void setSite(String site) {
    this.site = site;
  }
//tag::entity-inheritance-polymorphism-mapping-example[]
}
//end::entity-inheritance-polymorphism-mapping-example[]

相关文章