I'm using cglib for generating POJO-Classes to map hibernate-xml-files. I'm reading from the hibernatefiles to create classes. In Create simple POJO classes (bytecode) at runtime (dynamically) there is described how to generate these classes. but how to generate those classes that use a class that will be generated after the usage of the Type? So e.g.
public class Store{
private int id;
private String name;
private StoreDetails details; // Class not found!
//getters and setters
}
public class StoreDetail{
private Store store; //my id as foreign key - Class is found, everything is fine
private String detail1;
private int detail2;
//getters and setters
}
So class StoreDetail can use an attribute from type Store, but Store cannot use an attribute from type StoreDetail. StoreDetail is created after Store. Or is there any workaround? Other suggestions?