Hi all.

I think this is kind of a basic question. I have an application that haves 3 tables: users, messages and user_inbox for the relationship of first 2 ones. I have a class named MessagesManager in order to manage the messages to-and-from the database throught the business methods, one of them is the public List getMessages(String user_id) method that returns a MessageBean's list and I need to display the messages of each user in a html table, the MessageBean only contains the user_id but I want to display their names, do I need to modify my business method in order to get the usernames? or do I need to add another method to get the usernames, something like public String getName(String user_id)?, the first aproach makes one query to the database and the second aproach makes two. What is the best practice here? As you can see english is not my navite language, I hope you guys can understand my issue.

Thanks in advance.
Have a nice weekend.

--
Ing. Joel Alejandro Espinosa Carra
CINVESTAV CTS - Centro de TecnologĂ­a de Semiconductores
Tel. +52 (33) 3770-3700 ext. 1049
http://www.cts-design.com

--
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.
MailScanner agradece a transtec Computers por su apoyo.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to