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

x33g5p2x  于2022-01-29 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(116)

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

Transient介绍

暂无

代码示例

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

@Entity
@Table(name = "ZONE", schema=SchemaConstant.SALESMANAGER_SCHEMA)
public class Zone extends SalesManagerEntity<Long, Zone>{
  private static final long serialVersionUID = 1L;
  @Id
  @Column(name="ZONE_ID")
  @TableGenerator(name = "TABLE_GEN", table = "SM_SEQUENCER", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT",
  pkColumnValue = "ZONE_SEQ_NEXT_VAL")
  @GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN")
  private Long id;
  private Country country;
  @Transient
  private String name;
  @Column(name = "ZONE_CODE", unique=true, nullable = false)
  private String code;

代码示例来源: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: mitreid-connect/OpenID-Connect-Java-Spring-Server

@Override
@Transient
public Object getCredentials() {
  return "";
}

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

@Embeddable
public class Delivery {
  @Column (name ="DELIVERY_LAST_NAME", length=64)
  private String lastName;
  @Column (name ="DELIVERY_FIRST_NAME", length=64)
  private String firstName;
  @Column (name ="DELIVERY_COMPANY", length=100)
  private String company;
  private Zone zone;
  @Transient
  private String latitude = null;
  @Transient
  private String longitude = null;

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

@Entity(name = "MyEnhancedReferenceData")
@Immutable
@Cacheable
@SuppressWarnings("UnusedDeclaration")
public static class MyEnhancedReferenceData implements ManagedEntity {
  @Id
  private Integer id;
  private String name;
  private String theValue;
  @Transient
  private transient EntityEntry entityEntry;
  @Transient
  private transient ManagedEntity previous;
  @Transient
  private transient ManagedEntity next;

代码示例来源:origin: mitreid-connect/OpenID-Connect-Java-Spring-Server

/**
 * Get all additional information to be sent to the serializer as part of the token response.
 * This map is not persisted to the database.
 */
@Override
@Transient
public Map<String, Object> getAdditionalInformation() {
  return additionalInformation;
}

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

private ShoppingCart shoppingCart;
@Column(name="QUANTITY")
private Integer quantity = new Integer(1);
private AuditSection auditSection = new AuditSection();
@Transient
private boolean productVirtual;
private Set<ShoppingCartAttributeItem> attributes = new HashSet<ShoppingCartAttributeItem>();
@Transient
private BigDecimal itemPrice;//item final price including all rebates
@Transient
private BigDecimal subTotal;//item final price * quantity
@Transient
private FinalPrice finalPrice;//contains price details (raw prices)
@Transient
private Product product;
@Transient
private boolean obsolete = false;

代码示例来源:origin: mitreid-connect/OpenID-Connect-Java-Spring-Server

@Override
@Transient
public Object getDetails() {
  return null;
}

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

@Entity
@Table(name = "PRODUCT_IMAGE", schema=SchemaConstant.SALESMANAGER_SCHEMA)
public class ProductImage extends SalesManagerEntity<Long, ProductImage> {
  private static final long serialVersionUID = 247514890386076337L;
  @Id
  @Column(name = "PRODUCT_IMAGE_ID")
  @TableGenerator(name = "TABLE_GEN", table = "SM_SEQUENCER", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "PRODUCT_IMG_SEQ_NEXT_VAL")
  @GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN")
  private Long id;
  @Column(name = "PRODUCT_IMAGE")
  private String productImage;
  @Column(name = "DEFAULT_IMAGE")
  private boolean defaultImage = true;
  private Product product;
  @Transient
  private InputStream image = null;

代码示例来源:origin: mitreid-connect/OpenID-Connect-Java-Spring-Server

/**
 * This library does not make use of this field, so it is not
 * stored using our persistence layer.
 *
 * However, it's somehow required by SECOUATH.
 *
 * @return an empty map
 */
@Override
@Transient
public Map<String, Object> getAdditionalInformation() {
  return this.additionalInformation;
}

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

@Entity
@Table(name="PRODUCT_OPTION_VALUE", schema=SchemaConstant.SALESMANAGER_SCHEMA, indexes = { @Index(name="PRD_OPTION_VAL_CODE_IDX", columnList = "PRODUCT_OPTION_VAL_CODE")}, uniqueConstraints=
  @UniqueConstraint(columnNames = {"MERCHANT_ID", "PRODUCT_OPTION_VAL_CODE"}))
public class ProductOptionValue extends SalesManagerEntity<Long, ProductOptionValue> {
  private static final long serialVersionUID = 3736085877929910891L;
  @Id
  @Column(name="PRODUCT_OPTION_VALUE_ID")
  @TableGenerator(name = "TABLE_GEN", table = "SM_SEQUENCER", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "PRODUCT_OPT_VAL_SEQ_NEXT_VAL")
  @GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN")
  private Long id;
  @Column(name="PRODUCT_OPT_VAL_SORT_ORD")
  private Integer productOptionValueSortOrder;
  @Column(name="PRODUCT_OPT_VAL_IMAGE")
  private String productOptionValueImage;
  private Set<ProductOptionValueDescription> descriptions = new HashSet<ProductOptionValueDescription>();
  @Transient
  private MultipartFile image = null;
  @Transient
  private List<ProductOptionValueDescription> descriptionsList = new ArrayList<ProductOptionValueDescription>();

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

@Transient
public Date getRevisionDate() {
  return new Date( timestamp );
}

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

/**
 * @author Emmanuel Bernard
 */
@Entity
@Table(name = "tbl_sky",
    uniqueConstraints = {@UniqueConstraint(columnNames = {"`month`", "`day`"})}
)
public class Sky implements Serializable {
  @Id
  protected Long id;
  @Column(unique = true, columnDefinition = "varchar(250)", nullable = false)
  protected String color;
  @Column(name="`day`",nullable = false)
  protected String day;
  @Column(name = "`month`", nullable = false)
  protected String month;
  @Transient
  protected String area;
}

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

@Transient
public Date getRevisionDate() {
  return new Date( timestamp );
}

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

@Entity
@Table(name = "COUNTRY", schema=SchemaConstant.SALESMANAGER_SCHEMA)
@Cacheable
public class Country extends SalesManagerEntity<Integer, Country> {
  private static final long serialVersionUID = -7388011537255588035L;
  @Id
  @Column(name="COUNTRY_ID")
  @TableGenerator(name = "TABLE_GEN", table = "SM_SEQUENCER", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT",
  pkColumnValue = "COUNTRY_SEQ_NEXT_VAL")
  @GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN")
  private Integer id;
  private GeoZone geoZone;
  @Column(name = "COUNTRY_SUPPORTED")
  private boolean supported = true;
  @Column(name = "COUNTRY_ISOCODE", unique=true, nullable = false)
  private String isoCode;
  @Transient
  private String name;

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

@Transient
public Map getSessionData() {
  return sessionData;
}
public void setSessionData(Map sessionData) {

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

@Entity
@Table(name="CUSTOMER_OPTION_VALUE", schema=SchemaConstant.SALESMANAGER_SCHEMA, indexes = { @Index(name="CUST_OPT_VAL_CODE_IDX",columnList = "CUSTOMER_OPT_VAL_CODE")}, uniqueConstraints=
  @UniqueConstraint(columnNames = {"MERCHANT_ID", "CUSTOMER_OPT_VAL_CODE"}))
public class CustomerOptionValue extends SalesManagerEntity<Long, CustomerOptionValue> {
  private static final long serialVersionUID = 3736085877929910891L;
  @Id
  @Column(name="CUSTOMER_OPTION_VALUE_ID")
  @TableGenerator(name = "TABLE_GEN", table = "SM_SEQUENCER", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "CUSTOMER_OPT_VAL_SEQ_NEXT_VAL")
  @GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN")
  private Long id;
  @Column(name="SORT_ORDER")
  private Integer sortOrder = 0;
  @Column(name="CUSTOMER_OPT_VAL_IMAGE")
  private String customerOptionValueImage;
  private Set<CustomerOptionValueDescription> descriptions = new HashSet<CustomerOptionValueDescription>();
  @Transient
  private List<CustomerOptionValueDescription> descriptionsList = new ArrayList<CustomerOptionValueDescription>();

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

@Transient
public Map getSessionData() {
  return sessionData;
}
public void setSessionData(Map sessionData) {

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

@Entity
@Table(name="PRODUCT_ATTRIBUTE", schema=SchemaConstant.SALESMANAGER_SCHEMA,
  uniqueConstraints={
    @UniqueConstraint(columnNames={
  private static final long serialVersionUID = -6537491946539803265L;
  @Id
  @Column(name = "PRODUCT_ATTRIBUTE_ID", unique=true, nullable=false)
  @TableGenerator(name = "TABLE_GEN", table = "SM_SEQUENCER", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "PRODUCT_ATTR_SEQ_NEXT_VAL")
  @GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN")
  private Long id;
  @Column(name="PRODUCT_ATRIBUTE_PRICE")
  private BigDecimal productAttributePrice;
  @Column(name="PRODUCT_ATTRIBUTE_SORT_ORD")
  private Integer productOptionSortOrder;
  @Transient
  private String attributePrice = "0";
  @Transient
  private String attributeSortOrder = "0";
  @Transient
  private String attributeAdditionalWeight = "0";

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

@Transient
public Map getSessionData() {
  return sessionData;
}
public void setSessionData(Map sessionData) {

相关文章

Transient类方法