From ba1d525cbeda1960303c3571c9c999d0cca7bac5 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Fri, 27 Jul 2012 14:02:41 +0200
Subject: [PATCH] clean code

---
 hsarback/database/database_update.sql                     |    2 ++
 hsarback/database/schema.sql                              |    9 +--------
 hsarback/src/de/hsadmin/core/model/GenericModuleImpl.java |    4 ++++
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/hsarback/database/database_update.sql b/hsarback/database/database_update.sql
index c0bb0d8..9715a87 100644
--- a/hsarback/database/database_update.sql
+++ b/hsarback/database/database_update.sql
@@ -36,6 +36,8 @@
 alter table domain drop column domain_filed;
 alter table domain drop column domain_reminder;
 alter table domain drop column domain_template;
+alter table domain drop column domain_status;
+alter table domain drop column domain_status_changed;
 
 
 
diff --git a/hsarback/database/schema.sql b/hsarback/database/schema.sql
index bb6f054..98645d7 100644
--- a/hsarback/database/schema.sql
+++ b/hsarback/database/schema.sql
@@ -258,17 +258,10 @@
 
 CREATE TABLE domain (
     domain_name character varying(256) NOT NULL,
-    domain_status character varying(12) NOT NULL,
-    domain_status_changed date NOT NULL,
-    domain_filed date,
     domain_since date,
-    domain_until date,
     domain_dns_master character varying(64),
     domain_id integer DEFAULT nextval('domain_domain_id_seq'::regclass) NOT NULL,
-    domain_owner integer NOT NULL,
-    domain_reminder date,
-    domain_free boolean DEFAULT false NOT NULL,
-    domain_template character varying(32)
+    domain_owner integer NOT NULL
 );
 
 
diff --git a/hsarback/src/de/hsadmin/core/model/GenericModuleImpl.java b/hsarback/src/de/hsadmin/core/model/GenericModuleImpl.java
index e53cf61..b927513 100644
--- a/hsarback/src/de/hsadmin/core/model/GenericModuleImpl.java
+++ b/hsarback/src/de/hsadmin/core/model/GenericModuleImpl.java
@@ -101,6 +101,10 @@
 	private String getterName(Field f) {
 		String name = f.getName();
 		char firstChar = Character.toUpperCase(name.charAt(0));
+		Class<?> type = f.getType();
+		if (type.getCanonicalName().startsWith("boolean")) {
+			return "is" + firstChar + name.substring(1);
+		}
 		return "get" + firstChar + name.substring(1);
 	}
 

--
Gitblit v1.9.0-SNAPSHOT