Changeset 26 for trunk/fmgVen/test


Ignore:
Timestamp:
Jan 2, 2011, 8:51:21 PM (13 years ago)
Author:
fmguler
Message:

Refs #3 - Ven.save() is transferred to the new package. Save use case is completed. Convert.toDB() converts camel case object names to database names with underscores. Unchecked VenException is thrown by Ven methods. Liquibase changelog (test-db-changelog.xml) is changed to include only a simple object to test save operation. It creates a sample database table and inserts a sample row. On rollback it removes sample data. Using liquibase, Sample.java builds database, tests save operation and rolls back.

QueryGenerator generates insert and update queries for save and generates sequence query to assign ids to new objects. Ven calls query generator and runs the query using spring jdbc template.

Old codebase updated to run at Java 1.4

Location:
trunk/fmgVen/test/com/fmguler/ven/sample
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/fmgVen/test/com/fmguler/ven/sample/Sample.java

    r25 r26  
    4040    public static void main(String[] args) { 
    4141        buildDatabase(); 
    42         testGet(); 
    43         //rollbackDatabase(); 
     42        testSave(); 
     43        rollbackDatabase(); 
    4444    } 
    4545 
     
    139139            Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(getDataSource().getConnection()); 
    140140            Liquibase liquibase = new Liquibase("etc/test-db/test-db-changelog.xml", new FileSystemFileOpener(), database); 
    141             //liquibase.rollback(51, ""); 
    142             liquibase.rollback("0", ""); 
     141            liquibase.rollback("tag-single-table", ""); 
    143142            Locale.setDefault(currLocale); 
    144143        } catch (SQLException ex) { 
  • trunk/fmgVen/test/com/fmguler/ven/sample/domain/SomeDomainObject.java

    r23 r26  
    2525 */ 
    2626public class SomeDomainObject { 
    27     private int no; 
     27    private Integer id; 
    2828    private String name; 
    2929    private String description; 
     
    3131 
    3232    /** 
    33      * @return the no 
     33     * @return the id 
    3434     */ 
    35     public int getNo() { 
    36         return no; 
     35    public Integer getId() { 
     36        return id; 
    3737    } 
    3838 
    3939    /** 
    40      * @param no the no to set 
     40     * @param id the id to set 
    4141     */ 
    42     public void setNo(int no) { 
    43         this.no = no; 
     42    public void setId(Integer id) { 
     43        this.id = id; 
    4444    } 
    4545 
     
    8787 
    8888    public String toString() { 
    89         return no + " " + name + " " + description + " " + date; 
     89        return id + " " + name + " " + description + " " + date; 
    9090    } 
    9191} 
Note: See TracChangeset for help on using the changeset viewer.