title: Java reflection loss of annotation information
body: <p>I'm having an issue with reflection. I decided I wanted to create a SQL Query Generator using reflection. I created my own annotations to determine what classes can be used, what attributes can be stored ect. 
  The code works as I want it to, however the issue lyes in using this project as a dependency in others. </p>
  
  <p>I have another project using OJDBC and im trying to use my library to generate the Queries based on class. However when I pass a class from my ojdbc project there is a loss of all class information, the class is appearing as java.lang.Class and even the annotaion information is lost. 
  Does anyone know why this is happening?</p>
  
  <pre><code>private static &lt;T&gt; void appendTableName(Class&lt;T&gt; cls) throws NotStorableException {
      Storable storable = cls.getAnnotation(Storable.class);
      String tableName = null;
      if (storable != null) {
          if ((tableName = storable.tableName()).isEmpty())
              tableName = cls.getSimpleName();
      } else {    
          throw new NotStorableException(
                  "The class you are trying to persist must declare the Storable annotaion");
      }
      createStatement.append(tableName.toUpperCase());
  }
  </code></pre>
  
  <p>The <code>cls.getAnnotation(Storable.class)</code> is losing the information when the following class is passed to it </p>
  
  <pre><code>package com.fdm.ojdbc;
  
  import com.fdm.QueryBuilder.annotations.PrimaryKey;
  import com.fdm.QueryBuilder.annotations.Storable;
  
  @Storable(tableName="ANIMALS")
  public class Animal {
  
  @PrimaryKey
  private String name;
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  }
  </code></pre>
  
  <p>The animal class is in the ojdbc project and the appendTableName method belongs to my query builder. I have tried generating the querybuilder project into a jar and use maven install to add it to my repository and still no luck. </p>
  
  <p>Thanks for the quick reply, however this isn't problem as the Annotation I created has Retention set to Runtime see below.</p>
  
  <pre><code>package com.fdm.QueryBuilder.annotations;
  
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  @Target(value = { ElementType.TYPE })
  @Retention(value = RetentionPolicy.RUNTIME)
  public @interface Storable {
      public String tableName() default "";
  }
  </code></pre>
  
  <p>My annotation is set to runtime yet the class information is still being lost.</p>