# Java annotations and ORM generation

**URL:** <https://forums.visual-paradigm.com/t/java-annotations-and-orm-generation/11965>\
**Category:** General Questions/Discussions\
**Created:** [November 11, 2011, 11:54pm UTC](https://forums.visual-paradigm.com/t/java-annotations-and-orm-generation/11965 "2011-11-11T23:54:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![karimgarza](https://forums.visual-paradigm.com/user_avatar/forums.visual-paradigm.com/karimgarza/32/97_2.png) [@karimgarza](https://forums.visual-paradigm.com/u/karimgarza)\
**Post date:** [November 16, 2011, 12:04pm UTC](https://forums.visual-paradigm.com/t/java-annotations-and-orm-generation/11965/1 "2011-11-16T12:04:46Z")

</div>

Hi,

I added @Cacheable and @Cache(CacheConcurrencyStrategy.READ\_ONLY) to some of my classes. The orm generates the annotations correctly but I also need the ORM to add the following two import statements. Is there a way to include import statements on the entities generated by the ORM?

import org.hibernate.annotations.Cache;  
import org.hibernate.annotations.CacheConcurrencyStrategy;

Thank you,

Karim

---

<div class="post-metadata">

**Author:** ![karimgarza](https://forums.visual-paradigm.com/user_avatar/forums.visual-paradigm.com/karimgarza/32/97_2.png) [@karimgarza](https://forums.visual-paradigm.com/u/karimgarza)\
**Post date:** [November 16, 2011, 7:31pm UTC](https://forums.visual-paradigm.com/t/java-annotations-and-orm-generation/11965/2 "2011-11-16T19:31:35Z")

</div>

I got the following reply from tech support:

> I regret that we do not support adding those annotations to the generated code. Can you use fully qualified path in annotation?

A fully qualified path would work too.

Karim

---

<div class="post-metadata">

**Author:** ![Anonymous](https://avatars.discourse-cdn.com/v2/letter/a/8491ac/32.png) [@Anonymous](https://forums.visual-paradigm.com/u/Anonymous)\
**Post date:** [March 29, 2012, 10:30am UTC](https://forums.visual-paradigm.com/t/java-annotations-and-orm-generation/11965/3 "2012-03-29T10:30:10Z")

</div>

Hi Mathias,I have also implemented mioeimlthuds in a java framework that I am working on.I too wanted to be able to use abstract methods instead of interfaces so that I could put default implementation of methods in the interfcae definitions.Anyway, I am currently using the cglib library instead of Java [proxies.It](http://proxies.It) was very easy to replace java.lang.reflect.Proxy class with the net.sf.cglib.proxy.Enhancer class.Basically the Enhance lets you create a proxy using abstract classes instead of interfaces.Here’s an example of how to use it 123456Enhancer enhancer = new Enhancer(); enhancer.setSuperclass(roleClass); enhancer.setInterfaces(new Class[] { MeteorProxy.class }); enhancer.setCallback(new RoleInvocationHandler(\_repository, this, roleClass)); enhancer.setClassLoader(Activator.getMeteorClassloader()); role= (T)enhancer.create(); the classes passed to the setInterfaces method may include abstract classes as well as interfaces.Best Regards,ted stockwell
