java - spring annotation for entity that links other entities -


i writing calendar functionality spring mvc application. have calendar.jsp provides view of appointments, in turn associated providers , customers.

my underlying mysql database has tables appointments, providers, , customers. calendar abstraction user interface. calendar class not have associated table in database, calendar class have list of appointments , list of providers, etc. use @entity annotation appointments, providers, , customers.

what spring annotation should use calendar class?

i need able reference calendar.providers , calendar.appointments, etc. calendar.jsp.

here a link example of similar class uses roo annotation.

i prefer avoid using roo. nice able use base spring framework distribution. app uses spring , hibernate. avoid adding unnecessary complexity.

maybe i've missed here sure you're not overcomplicating things? if want expose populated calendar instance in jsp, after populating add model in controller method.

provided calendar has java bean style properties providers , appointments can use dotted notation access data in jsp.

for example, without seeing controller code:

@controller public class somecontroller {      @requestmapping("/calendar")     public string showcalendar(model model) {         calendar calendar = getcalendar() // or whatever create         model.addattribute("calendar", calendar);         return "calendar";     }      ... } 

and in calendar.jsp:

<c:foreach var="appointment" items="${calendar.appointments}">     <c:out value="${appointment.time}" /> <%-- access fields in usual manner --%> </c:foreach> 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -