9.2 View The Same Object In Different Ways

Say you have an object Employee:

public class Employee {
			
	...
	
	@Column( nullable = false )
	public String getName() {
		return mName;
	}

	public boolean isManager() {
		return mManager;
	}
}

You have a requirement to construct both a screen to view an individual employee, and a screen to search for employees. For the latter you would like to reuse the Employee class but display its properties a little differently. For example, your individual employee screen may use JpaInspector/HibernateInspector to pick up on the @Column annotation and mark the name property as 'required'. For your search screen you may not want this.

You have some options: