can you use CMP in database view?

Discussions

EJB programming & troubleshooting: can you use CMP in database view?

  1. can you use CMP in database view? (3 messages)

    hi all,
    I got a question regarding the cmp:

    I remember I read this in somewhere: if you trying to mapping the fields in a entity bean which involve different tables you can only use BMP. What about mapping to views? I am only familiar with MS SQL Database, I was wondering since you can call SQL statement in view (which actually involve multiple tables), can you map your fields to View? is this going to work?

    Thank you very much to any commends in advance!

  2. can you use CMP in database view?[ Go to top ]

    Without knowing more about what you're trying to do, I would say yes, you can, but you need to verify that the view you are using is updatable. Depending on how you have structured your view, you may not be able to update it, which would preclude it from being used in your CMPs.

    Mark
  3. Well,
    I guess views will be excellent if ur EJB is read only .. ie u r not updating any data.
    Else u have to take care of the fields in the view whether updatable or allow for nulls.

    Views will definitely help in case where data is to be fetched from multiple tables (say a join)

    regards
    Jani
  4. can you use CMP in database view?[ Go to top ]

    Excellent, thank you very much guys!

    Well, if I am sure my view is updateable so CMP should work, right?

    Regards,