/* * Copyright 2009 SIB Visions GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. * * * History * * 27.11.2009 - [HM] - creation */ package com.sibvisions.apps.showcase.frames; import com.sibvisions.apps.showcase.Session; import com.sibvisions.rad.persist.jdbc.DBStorage; /** * The ContactsAuto class is the life-cycle object for ContactsAutoFrame. * * @author Martin Handsteiner */ public class ContactsAuto extends Session { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Members //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** storage for contacts. */ private DBStorage dbsContacts = null; /** Storage for contacts educations. */ private DBStorage dbsContEduc = null; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // User-defined methods //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Returns the contacts storage. * * @return the Contacts storage * @throws Exception if the initialization throws an error */ public DBStorage getContacts() throws Exception { if (dbsContacts == null) { dbsContacts = new DBStorage(); dbsContacts.setDBAccess(getDBAccess()); dbsContacts.setWritebackTable("CONTACTS"); dbsContacts.setAutoLinkReference(true); dbsContacts.open(); } return dbsContacts; } /** * Returns the contacts educations storage. * * @return the contacts storage * @throws Exception if the initialization throws an error */ public DBStorage getContEduc() throws Exception { if (dbsContEduc == null) { dbsContEduc = new DBStorage(); dbsContEduc.setDBAccess(getDBAccess()); dbsContEduc.setWritebackTable("CONT_EDUC"); dbsContEduc.setAutoLinkReference(true); dbsContEduc.open(); } return dbsContEduc; } } // ContactsAuto