projects
/
mir.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merged 1.1 branch into head
[mir.git]
/
source
/
mircoders
/
storage
/
DatabaseOther.java
diff --git
a/source/mircoders/storage/DatabaseOther.java
b/source/mircoders/storage/DatabaseOther.java
index
c4c422b
..
dd641f9
100755
(executable)
--- a/
source/mircoders/storage/DatabaseOther.java
+++ b/
source/mircoders/storage/DatabaseOther.java
@@
-36,25
+36,11
@@
import mir.entity.Entity;
import mir.log.LoggerWrapper;
import mir.misc.StringUtil;
import mir.storage.Database;
import mir.log.LoggerWrapper;
import mir.misc.StringUtil;
import mir.storage.Database;
-import mir.storage.StorageObject;
-import mir.storage.StorageObjectFailure;
+import mir.storage.DatabaseFailure;
-/**
- *
- * <p>Title: </p>
- * <p>Description: </p>
- * <p>Copyright: Copyright (c) 2003</p>
- * <p>Company: </p>
- * @author not attributable
- * @version 1.0
- */
-
-public class DatabaseOther extends Database implements StorageObject{
+public class DatabaseOther extends Database {
private static DatabaseOther instance;
private static DatabaseOther instance;
- // the following *has* to be sychronized cause this static method
- // could get preemted and we could end up with 2 instances of DatabaseFoo..
- // see the "Singletons with needles and thread" article at JavaWorld -mh
public synchronized static DatabaseOther getInstance() {
if (instance == null) {
instance = new DatabaseOther();
public synchronized static DatabaseOther getInstance() {
if (instance == null) {
instance = new DatabaseOther();
@@
-66,14
+52,11
@@
public class DatabaseOther extends Database implements StorageObject{
super();
logger = new LoggerWrapper("Database.OtherMedia");
super();
logger = new LoggerWrapper("Database.OtherMedia");
-
- hasTimestamp = true;
mainTable = "other_media";
mainTable = "other_media";
- primaryKeySequence = "media_id_seq";
- theEntityClass = mircoders.entity.EntityOther.class;
+ entityClass = mircoders.entity.EntityOther.class;
}
}
- public void update(Entity theEntity) throws
StorageObject
Failure {
+ public void update(Entity theEntity) throws
Database
Failure {
String date = theEntity.getFieldValue("date");
if (date == null) {
date = StringUtil.date2webdbDate(new GregorianCalendar());
String date = theEntity.getFieldValue("date");
if (date == null) {
date = StringUtil.date2webdbDate(new GregorianCalendar());
@@
-83,7
+66,7
@@
public class DatabaseOther extends Database implements StorageObject{
super.update(theEntity);
}
super.update(theEntity);
}
- public String insert(Entity theEntity) throws
StorageObject
Failure {
+ public String insert(Entity theEntity) throws
Database
Failure {
String date = theEntity.getFieldValue("date");
if (date == null) {
date = StringUtil.date2webdbDate(new GregorianCalendar());
String date = theEntity.getFieldValue("date");
if (date == null) {
date = StringUtil.date2webdbDate(new GregorianCalendar());
@@
-92,6
+75,7
@@
public class DatabaseOther extends Database implements StorageObject{
return super.insert(theEntity);
}
return super.insert(theEntity);
}
- // initialisierungen aus den statischen Tabellen
-
+ protected String getPrimaryKeySequence() {
+ return "media_id_seq";
+ }
}
}