I'm looking for a way to use aspects to inject parameters in hibernate annotated classes.
Here is a user :
@Entity
public class User implements IHasCity {
@Id
private int id;
private String name;
}
public interface IHasCity {
}
Here is an aspect contributing to that User
public aspect ACity {
@Column
private String IHasCity.cityName;
private String IHasCity.getCityName(){
return this.cityName;
}
}
Now i'd like to make an request :
If i'm doing like :
"from User" i have no problems to do like result.getCityName().
If i do "from User where cityName=?" it doesn't work ...
It is due to aspect waving. instead of associating my private String cityName to "cityName" in hibernate, it associates it to the unusable intertype name : something like class$ajc$intertype$interface$cityName.
Do you have a way around this ? changing hql attributes names associations ?
Thank you very much !