From 24feb58ef5809a9e26ba5b8e11f6e099bc3514c7 Mon Sep 17 00:00:00 2001
From: undisclosed
Date: Wed, 21 Dec 2022 15:19:24 +0000
Subject: [PATCH] Timestamp ergaenzt

---
 src/de/uhilger/baselink/Util.java |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/src/de/uhilger/baselink/Util.java b/src/de/uhilger/baselink/Util.java
index d37afa7..ac16d6b 100644
--- a/src/de/uhilger/baselink/Util.java
+++ b/src/de/uhilger/baselink/Util.java
@@ -1,6 +1,6 @@
 /*
  *  BaseLink - Generic object relational mapping
- *  Copyright (C) 2011  Ulrich Hilger, http://uhilger.de
+ *  Copyright (C) 2011-2020  Ulrich Hilger, http://uhilger.de
  *
  *  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
@@ -38,13 +38,14 @@
   public static final boolean DONT_INCLUDE_BLOBS = false;
   
   /**
-   * Generate a database access object (DAO) for a table
+   * Generate a database transfer object (DTO) for a table
+   * 
    * @param pm  an object to be used for database access
    * @param schemaName name of database schema that contains the table 
    * @param tableName name of table to create DAO for
-   * @return java source code of DAO
+   * @return java source code of DTO
    */
-  public String generateDAO(PersistenceManager pm, String schemaName, String tableName) {
+  public String generateDTO(PersistenceManager pm, String schemaName, String tableName) {
     String indentation = "  ";
     //String indent = "";
     StringBuilder code = new StringBuilder();
@@ -160,6 +161,21 @@
       pm.closeConnectionFinally(c);
     }
     return code.toString();    
+  }
+  
+  /**
+   * Generate a database transfer object (DTO) for a table
+   * 
+   * This method is kept for compatibility reasons, it maps to 
+   * <code>generateDTO</code>.
+   * 
+   * @param pm  an object to be used for database access
+   * @param schemaName name of database schema that contains the table 
+   * @param tableName name of table to create DAO for
+   * @return java source code of DTO
+   */
+  public String generateDAO(PersistenceManager pm, String schemaName, String tableName) {
+    return generateDTO(pm, schemaName, tableName);
   }
   
   /**
@@ -323,7 +339,7 @@
         typename = "tbd_TIME";
         break;
       case java.sql.Types.TIMESTAMP:
-        typename = "tbd_TIMESTAMP";
+        typename = "java.sql.Timestamp";
         break;
       case java.sql.Types.TINYINT:
         typename = "integer";

--
Gitblit v1.9.3