|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.claudio.contactdb.Model
public class Model
The model will contain all procedures to be called from the different views.
I switched in the early phase from using a traditional SQL database to db4o. Beeing this the first project where I use an object database, and as with an object database you just store your instances instead of having to create SQL statements, I refreined of having a special class for handling the databse. This, because in my first attempt at an object db design I would not know yet, where the separation line between this and the DBInterface module would be.
The structure of the database is defined through the classes in the ch.claudio.contactdb.data package.
Copyright (C) 2005-2006 Claudio Nieder <private@claudio.ch>, CH-8610 Uster
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Field Summary | |
---|---|
static java.lang.String |
dbname
Name of the database file |
Constructor Summary | |
---|---|
Model()
|
Method Summary | |
---|---|
java.util.List<Address> |
addAddress(Address addr)
Test it the person ist not yet stored in the database and add it.. |
java.util.List<Message> |
addMessage(Message msg)
Test with the help of a digest, if the message was already added to the database. |
java.util.List<Person> |
addPerson(Person pers)
Test it the person ist not yet stored in the database and add it.. |
java.util.List<Place> |
addPlace(Place place)
Test it the person ist not yet stored in the database and add it.. |
java.util.Vector<java.lang.String> |
getPersonNames()
Generate a list of the names of all persons. |
static void |
main(java.lang.String[] args)
Print license. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String dbname
Constructor Detail |
---|
public Model()
Method Detail |
---|
public java.util.List<Message> addMessage(Message msg)
msg
- Message text
public java.util.List<Place> addPlace(Place place)
place
- Person object
public java.util.List<Person> addPerson(Person pers)
pers
- Person object
public java.util.List<Address> addAddress(Address addr)
addr
- Person object
public java.util.Vector<java.lang.String> getPersonNames()
public static void main(java.lang.String[] args)
args
- ignored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |