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

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

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

EntityListeners.<init>介绍

暂无

代码示例

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

/**
 * @author Oliver Gierke
 */
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class AbstractEntity {

  @Id @GeneratedValue Long id;

  @CreatedDate LocalDateTime createdDate;
  @LastModifiedDate LocalDateTime modifiedDate;
}

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

@Data
@RequiredArgsConstructor
@EntityListeners(AuditingEntityListener.class)
public class Customer {

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

/**
 * User domain class that uses auditing functionality of Spring Data that can either be aquired implementing
 * {@link Auditable} or extend {@link AbstractAuditable}.
 *
 * @author Oliver Gierke
 * @author Thomas Darimont
 */
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
public class AuditableUser {

  private @Id @GeneratedValue Long id;
  private String username;

  private @CreatedDate LocalDateTime createdDate;
  private @LastModifiedDate LocalDateTime lastModifiedDate;

  private @ManyToOne @CreatedBy AuditableUser createdBy;
  private @ManyToOne @LastModifiedBy AuditableUser lastModifiedBy;
}

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

@Entity( name = "AnotherEntity" )
@Table( name = "another_entity")
@EntityListeners( AnotherListener.class )
public static class AnotherEntity {
  private Integer id;
  private String name;
  public AnotherEntity() {
  }
  public AnotherEntity(Integer id) {
    this.id = id;
  }
  @Id
  public Integer getId() {
    return id;
  }
  public void setId(Integer id) {
    this.id = id;
  }
  public String getName() {
    return name;
  }
  public void setName(String name) {
    this.name = name;
  }
}

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

@EntityListeners( TheListener.class )
public class TheEntity {
  private Integer id;

代码示例来源:origin: shopizer-ecommerce/shopizer

@Entity
@EntityListeners(value = AuditListener.class)
@Table(name = "PRODUCT_TYPE", schema=SchemaConstant.SALESMANAGER_SCHEMA)
public class ProductType extends SalesManagerEntity<Long, ProductType> implements Auditable {

代码示例来源:origin: shopizer-ecommerce/shopizer

@EntityListeners(value = AuditListener.class)
@Table(name = "SYSTEM_CONFIGURATION", schema= SchemaConstant.SALESMANAGER_SCHEMA)
public class SystemConfiguration extends SalesManagerEntity<Long, SystemConfiguration> implements Serializable, Auditable {

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

@Entity
@EntityListeners( LastUpdateListener.class )
public static class Person {
  @Id
  private Long id;
  private String name;
  private Date dateOfBirth;
  @Transient
  private long age;
  private Date lastUpdate;
  public void setLastUpdate(Date lastUpdate) {
    this.lastUpdate = lastUpdate;
  }
  /**
   * Set the transient property at load time based on a calculation.
   * Note that a native Hibernate formula mapping is better for this purpose.
   */
  @PostLoad
  public void calculateAge() {
    age = ChronoUnit.YEARS.between( LocalDateTime.ofInstant(
        Instant.ofEpochMilli( dateOfBirth.getTime()), ZoneOffset.UTC),
      LocalDateTime.now()
    );
  }
}

代码示例来源:origin: shopizer-ecommerce/shopizer

@Entity
@EntityListeners(value = AuditListener.class)
@Table(name = "MERCHANT_LOG", schema= SchemaConstant.SALESMANAGER_SCHEMA)
public class MerchantLog extends SalesManagerEntity<Long, MerchantLog> implements Serializable {

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

@EntityListeners(PersonListener.class)
public class Person {

代码示例来源:origin: shopizer-ecommerce/shopizer

@Entity
@EntityListeners(value = AuditListener.class)
@Table(name = "SHOPPING_CART_ATTR_ITEM", schema=SchemaConstant.SALESMANAGER_SCHEMA)
public class ShoppingCartAttributeItem extends SalesManagerEntity<Long, ShoppingCartAttributeItem> implements Auditable {

代码示例来源:origin: shopizer-ecommerce/shopizer

@Entity
@EntityListeners(value = AuditListener.class)
@Table(name = "SM_GROUP", schema=SchemaConstant.SALESMANAGER_SCHEMA)
public class Group extends SalesManagerEntity<Integer, Group> implements Auditable {

代码示例来源:origin: BroadleafCommerce/BroadleafCommerce

@EntityListeners(value = { AdminAuditableListener.class })
@Table(name = "BLC_IMG_STATIC_ASSET")
@Cache(usage= CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region="blCMSElements")

代码示例来源:origin: shopizer-ecommerce/shopizer

@Entity
@EntityListeners(value = AuditListener.class)
@Table(name = "PERMISSION", schema=SchemaConstant.SALESMANAGER_SCHEMA)
public class Permission extends SalesManagerEntity<Integer, Permission> implements Auditable {

代码示例来源:origin: kbastani/spring-cloud-event-sourcing-example

@EntityListeners(AuditingEntityListener.class)
public class BaseEntity {

代码示例来源:origin: kbastani/spring-cloud-event-sourcing-example

@EntityListeners(AuditingEntityListener.class)
public class BaseEntity {

代码示例来源:origin: kbastani/spring-cloud-event-sourcing-example

@EntityListeners(AuditingEntityListener.class)
public class BaseEntity {

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

@EntityListeners(LastUpdateListener.class)
public class Cat implements Serializable {
  private static final Logger log = Logger.getLogger( Cat.class );

代码示例来源:origin: BroadleafCommerce/BroadleafCommerce

@EntityListeners(value = { AdminAuditableListener.class })
public final class WeaveAdminAuditable implements AdminAudit {

代码示例来源:origin: BroadleafCommerce/BroadleafCommerce

@Entity
@EntityListeners(value = { TemporalTimestampListener.class })
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "BLC_ROLE")

相关文章