Foros de discusión
Invoke methods in *PersistenceImpl classes of DLFileEntry
Siby Mathew, modificado hace 12 años.
Invoke methods in *PersistenceImpl classes of DLFileEntry
Expert Mensajes: 268 Fecha de incorporación: 4/03/11 Mensajes recientes
Hi all,
My scenario is regarding DLFileEntryPersistenceImpl.findByG_F_N() which throws an exception if result is null.
But as this method will be invoked multiple times during a page load, I dont want the code to throw the exception. Instead I want to invoke DLFileEntryPersistenceImpl.fetchByG_F_N() which returns only NULL.
But this method is invoked only in DLFileEntryUtil.java which cannot be directly accessed.
How can we invoke the DLFileEntryPersistenceImpl.fetchByG_F_N() through a service.
Can anyone please clarify.
Thanks,
Siby
My scenario is regarding DLFileEntryPersistenceImpl.findByG_F_N() which throws an exception if result is null.
But as this method will be invoked multiple times during a page load, I dont want the code to throw the exception. Instead I want to invoke DLFileEntryPersistenceImpl.fetchByG_F_N() which returns only NULL.
But this method is invoked only in DLFileEntryUtil.java which cannot be directly accessed.
How can we invoke the DLFileEntryPersistenceImpl.fetchByG_F_N() through a service.
Can anyone please clarify.
Thanks,
Siby
David H Nebinger, modificado hace 12 años.
RE: Invoke methods in *PersistenceImpl classes of DLFileEntry
Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
You cannot access the persistence layer directly.
Instead you should use the dynamic query API to call the service to return the list. The DQ api will not throw an exception when no results are found.
Instead you should use the dynamic query API to call the service to return the list. The DQ api will not throw an exception when no results are found.
Siby Mathew, modificado hace 12 años.
RE: Invoke methods in *PersistenceImpl classes of DLFileEntry
Expert Mensajes: 268 Fecha de incorporación: 4/03/11 Mensajes recientes
Hi David,
Thanks for your reply. I had planned this for a performance optimization.
As Dynamic query does not have a cache, don't you think it might create more overhead ?
Also is there no way to invoke a method already present in the PersistenceImpl class
Thanks for your reply. I had planned this for a performance optimization.
As Dynamic query does not have a cache, don't you think it might create more overhead ?
Also is there no way to invoke a method already present in the PersistenceImpl class
David H Nebinger, modificado hace 12 años.
RE: Invoke methods in *PersistenceImpl classes of DLFileEntry
Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
You cannot access the persistence methods outside of the service implementation classes.