title: Read from property file in entity
body: <p>I have an attribute expiryDate in my entity. i want when i ceate an instance from this entity, i set the value of the attribute expiryDate. The value is in the application.yml file. I used <code>Properties.getProperty</code> in the construct but it didn't work</p>
  
  <p>application.yml:</p>
  
  <pre><code>application:
    token:
      expiredIn: 1440
  </code></pre>
  
  <p>Token entity:</p>
  
  <pre><code>public abstract class Token implements Serializable {
  
      @Id
      private UUID id;
  
      private int expiryIn;
  
      public Token() {
          this.expiryIn= Properties.getProperty("application.token.expiredIn");
      }
  
  }
  </code></pre>
  
  <p><strong>#UPDATE</strong></p>
  
  <p>I used <code>@Value</code> but the value of expiration is always 0</p>
  
  <pre><code>public abstract class Token implements Serializable {
  
      @Id
      private String id;
  
      private Date expiryDate;
  
      @Value("${application.token.expiredIn}")
      private static int expiration;
  
      public Token() {
          this.expiryDate = calculateExpiryDate(expiration);
      }
  
      private Date calculateExpiryDate(final int expiryTimeInMinutes) {
          final Calendar cal = Calendar.getInstance();
          cal.setTimeInMillis(new Date().getTime());
          cal.add(Calendar.MINUTE, expiryTimeInMinutes);
          return new Date(cal.getTime().getTime());
      }
  
  }
  </code></pre>