Changeset 23 for trunk


Ignore:
Timestamp:
Jul 20, 2010, 7:47:08 PM (14 years ago)
Author:
fmguler
Message:

Refs #3 - Spring 2.5 libraries are added. Old spring 2 jar is removed. The main dependency is spring-jdbc.jar and spring-beans.jar, spring-core.jar and spring-tx.jar are referenced from them. For testing with postgresql, its driver is added.

The interface is translated to the new Ven class. Instead of adding 'object' to all of the methods, I aimed to make it less verbose, so just shortened the name of the methods to list, get save, delete.

Lastly, we have a class to demonstrate the usage called 'Sample' in the test packages.

Location:
trunk/fmgVen
Files:
17 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/fmgVen/lib/nblibraries.properties

    r11 r23  
    55libs.CopyLibs.classpath=\ 
    66    ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar 
     7libs.Test.classpath=\ 
     8    ${base}/test/postgresql-8.4-701.jdbc3.jar 
     9libs.Ven.classpath=\ 
     10    ${base}/ven/spring-beans.jar;\ 
     11    ${base}/ven/spring-core.jar;\ 
     12    ${base}/ven/spring-jdbc.jar;\ 
     13    ${base}/ven/spring-tx.jar;\ 
     14    ${base}/ven/commons-logging-1.1.1.jar 
  • trunk/fmgVen/nbproject/genfiles.properties

    r19 r23  
    1 build.xml.data.CRC32=d00ffa57 
     1build.xml.data.CRC32=6b84a8b1 
    22build.xml.script.CRC32=a9b2e5a3 
    33build.xml.stylesheet.CRC32=28e38971@1.38.1.45 
    44# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 
    55# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 
    6 nbproject/build-impl.xml.data.CRC32=d00ffa57 
     6nbproject/build-impl.xml.data.CRC32=6b84a8b1 
    77nbproject/build-impl.xml.script.CRC32=494c2ca4 
    88nbproject/build-impl.xml.stylesheet.CRC32=78c6a6ee@1.38.1.45 
  • trunk/fmgVen/nbproject/project.properties

    r22 r23  
    2525endorsed.classpath= 
    2626excludes= 
    27 file.reference.spring.jar=lib/spring.jar 
    2827includes=** 
    2928jar.compress=false 
    3029javac.classpath=\ 
    31     ${file.reference.spring.jar} 
     30    ${libs.Ven.classpath} 
    3231# Space-separated list of extra javac options 
    33 javac.compilerargs= 
     32javac.compilerargs=-Xlint:deprecation 
    3433javac.deprecation=false 
    3534javac.processorpath=\ 
     
    6362run.test.classpath=\ 
    6463    ${javac.test.classpath}:\ 
    65     ${build.test.classes.dir} 
     64    ${build.test.classes.dir}:\ 
     65    ${libs.Test.classpath} 
    6666source.encoding=UTF-8 
    6767src.dir=src 
  • trunk/fmgVen/nbproject/project.xml

    r11 r23  
    1616            <definitions>.\lib\nblibraries.properties</definitions> 
    1717        </libraries> 
     18        <spring-data xmlns="http://www.netbeans.org/ns/spring-data/1"> 
     19            <config-files/> 
     20            <config-file-groups/> 
     21        </spring-data> 
    1822    </configuration> 
    1923</project> 
  • trunk/fmgVen/src/com/fmguler/ven/Ven.java

    r22 r23  
    1818package com.fmguler.ven; 
    1919 
     20import java.util.List; 
     21import javax.sql.DataSource; 
     22import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; 
     23 
    2024/** 
    2125 * The main class for data access 
     
    2327 */ 
    2428public class Ven { 
     29    private NamedParameterJdbcTemplate template; 
     30    private QueryGenerator generator; 
     31    private QueryMapper mapper; 
     32 
     33    public Ven() { 
     34        generator = new QueryGenerator(); 
     35        mapper = new QueryMapper(); 
     36    } 
     37 
     38    public List list() { 
     39        return null; 
     40    } 
     41 
     42    public int count() { 
     43        return 0; 
     44    } 
     45 
     46    public Object get(int no, Class objectClass) { 
     47        return null; 
     48    } 
     49 
     50    public void save(Object object) { 
     51    } 
     52 
     53    public void delete(int no, Class objectClass) { 
     54    } 
     55 
     56    //SETTERS------------------------------------------------------------------- 
     57    public void setDataSource(DataSource dataSource) { 
     58        if (dataSource == null) throw new RuntimeException("fmgVen - DataSource cannot be null"); 
     59        this.template = new NamedParameterJdbcTemplate(dataSource); 
     60    } 
     61 
     62    public Ven addDomainPackage(String domainPackage) { 
     63        generator.addDomainPackage(domainPackage); 
     64        mapper.addDomainPackage(domainPackage); 
     65        return this; 
     66    } 
    2567} 
  • trunk/fmgVen/src/net/fmg/ven/SorguEslestirici.java

    r22 r23  
    124124                 
    125125            } 
    126         } catch(SQLException ex){ 
     126        } catch(Exception ex){ 
    127127            ex.printStackTrace(); 
    128128        } 
Note: See TracChangeset for help on using the changeset viewer.