1 /* 2 * Copyright Openmind http://www.openmindonline.it 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package it.openutils.spring.rmibernate.shared.managers; 18 19 import java.io.Serializable; 20 import java.rmi.RemoteException; 21 22 23 /** 24 * Interface for server-side remote lazy loading calls 25 * @author mmolaschi 26 * @version $Id: HibernateLazyService.java 716 2008-03-03 14:35:57Z fcarone $ 27 */ 28 public interface HibernateLazyService 29 { 30 /** 31 * Invoke remote lazy loading 32 * @param className name of parent class 33 * @param propertyName name of property to load 34 * @param id current entity id 35 * @return loaded object / collection 36 * @throws RemoteException error 37 */ 38 Object invoke(String className, String propertyName, Serializable id) throws RemoteException; 39 40 /** 41 * Invoke remote lazy loading 42 * @param className name of parent class 43 * @param propertyName name of property to load 44 * @param id current entity id 45 * @param from starting row number 46 * @param size max rows to return 47 * @return loaded object / collection 48 * @throws RemoteException error 49 */ 50 Object invoke(String className, String propertyName, Serializable id, int from, int size) throws RemoteException; 51 52 /** 53 * Get collection size 54 * @param className name of parent class 55 * @param propertyName name of property to load 56 * @param id current entity id 57 * @return loaded object / collection 58 * @throws RemoteException error 59 */ 60 long count(String className, String propertyName, Serializable id) throws RemoteException; 61 }