001package io.ebean.annotation; 002 003import java.lang.annotation.ElementType; 004import java.lang.annotation.Retention; 005import java.lang.annotation.RetentionPolicy; 006import java.lang.annotation.Target; 007 008/** 009 * Deprecated migrate to <code>@WhenCreated</code>. 010 * 011 * For a timestamp property that is set to the datetime when the entity is 012 * created/inserted. 013 * <p> 014 * This is effectively an alias for @WhenCreated which was added as it hints 015 * towards a better naming convention (WhenCreated, WhenModified). 016 * </p> 017 * <p> 018 * An alternative to using this annotation would be to use insertable=false, 019 * updateable=false with @Column and have the DB insert the current time 020 * (default value on the DB column is SYSTIME etc). 021 * </p> 022 * <p> 023 * The downside to this approach is that the inserted entity does not have the 024 * timestamp value after the insert has occurred. You need to fetch the entity 025 * back to get the inserted timestamp if you want to used it. 026 * </p> 027 * <p> 028 * <h3>Example:</h3> 029 * <pre>{@code 030 * 031 * @CreatedTimestamp 032 * Timestamp whenCreated; 033 * 034 * }</pre> 035 */ 036@Deprecated 037@Target({ElementType.FIELD}) 038@Retention(RetentionPolicy.RUNTIME) 039public @interface CreatedTimestamp { 040 041}