Code example for ToOne

Methods: getReferencedEntityName

	public Object accept(ManyToOne o) {
		return acceptToOne(o);
	private Object acceptToOne(ToOne value) {
		return value.getReferencedEntityName(); // should get the cfg and lookup the persistenclass.			
	public Object accept(OneToMany value) {
		return value.getAssociatedClass().getEntityName();
	public Object acceptCollection(Collection c) {
		return c.getElement().accept( this );
	public Object accept(Bag o) {
		return acceptCollection( o );
Contextual code suggestions in your IDE  Get Codota for Java