hi all,
I use apectwerkz as aop framework to build pure mixin implementation for domain objects.
so that, We have Person.class mixin with Identifiable and HasName Interface/Implement:
Code:
Public class Person {
}
Code:
public interface Identifiable {
public void setId(Serializable id);
public Serializable getId();
}
Code:
public class IdentifiableImpl implements Identifiable {
Serializable _id;
public void setId(Serializable id) {
_id = id;
}
public Serializable getId() {
return _id;
}
}
Code:
public interface HasName {
public void setName(String name);
public String getName();
}
Code:
public class HasNameImpl implements HasName {
String _name;
public void setName(String name) {
_name = name;
}
public String getName() {
return _name;
}
}
Code:
Table Person:
column id String
column name String
when we build the person object use following:
Code:
Person p = new Person();
((Identifiable)p).setId("abc");
((HasName)p).setName("xyz");
....
The question is how to persistent the person object to database via Hibernate?
If it's possible, please give me a hint
Thanks for help!
yiming wang
Code: