001 /* 002 @license.text@ 003 */ 004 package biz.hammurapi.sql; 005 006 import java.sql.SQLException; 007 import java.util.Collection; 008 009 /** 010 * @author Pavel Vlasov 011 * @revision $Revision$ 012 */ 013 public interface Relationship { 014 void load(SQLProcessor processor, Collection receiver) throws SQLException; 015 016 void store(SQLProcessor processor) throws SQLException; 017 018 void add(DatabaseObject item); 019 020 void remove(IDatabaseObject item); 021 022 boolean isLazy(); 023 024 boolean isModified(); 025 026 /** 027 * Updates modified relationship items. 028 * @param processor 029 * @param subItem 030 * @throws SQLException 031 */ 032 void update(SQLProcessor processor, IDatabaseObject subItem) throws SQLException; 033 034 Class getItemType(); 035 036 /** 037 * Callback method to propagate updates 038 * @param master 039 */ 040 void setMaster(Collection master); 041 }