i am wondering how i would be able to annotate an interface
@Entity
@Table(name = \"FOLDER_TABLE\")
public class Folder implements Serializable, Hierarchy {
You can map interfaces in Hibernate, as part of inheritance hierarchies. This is quite surely possible with XML mapping, as it is described in Chapter 9 of the Hibernate reference, among others.
Annotation based mapping is a different story though. I am not so familiar with it, but Java Persistence with Hibernate includes examples for this too. Adapted to your case, it would look like
@MappedSuperclass
public interface Hierarchy {
}
@Entity
@Table(name = "FOLDER_TABLE")
public class Folder implements Serializable, Hierarchy { ... }
@Entity
@Table(name = "FILE_INFORMATION_TABLE")
public class FileInformation implements Serializable, Hierarchy { ... }
This mapping would use a table per concrete class with implicit polymorphism.
However, other sources suggest that annotation support for interfaces may not be working / stable yet:
@Entity
annotation with interfaces, which also includes some patches,So you may need to experiment, including changing your inheritance mapping strategy, maybe turning the interface into an abstract class (if it's possible - since a class can only extend a single base class)...