Changeset 32 for trunk/fmgVen/src


Ignore:
Timestamp:
Oct 21, 2011, 3:37:55 PM (13 years ago)
Author:
fmguler
Message:

Fixed typed criteria method parameters from Criteria.eq(String attribute, String value) to eq(String attribute, Object value). They accept values of any type, e.g. int, string, date.

Turned off debug messages by default. They can be enabled by setting Ven.setDebug(true).

Updated to Netbeans 7.0.1, which updated build-impl.xml, nothing to do with functionality.

Location:
trunk/fmgVen/src/com/fmguler/ven
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/fmgVen/src/com/fmguler/ven/Criteria.java

    r30 r32  
    104104     * Add a criterion where an attribue equals a value (SQL = operator) 
    105105     */ 
    106     public Criteria eq(String attribute, String value) { 
     106    public Criteria eq(String attribute, Object value) { 
    107107        criterionList.add(new Criterion(attribute, Criterion.OP_EQUALS, value)); 
    108108        return this; 
     
    112112     * Add a criterion where an attribue is like a value (SQL like operator) 
    113113     */ 
    114     public Criteria like(String attribute, String value) { 
     114    public Criteria like(String attribute, Object value) { 
    115115        criterionList.add(new Criterion(attribute, Criterion.OP_LIKE, value)); 
    116116        return this; 
     
    120120     * Add a criterion where an attribue is similar to a value (SQL similar to operator) 
    121121     */ 
    122     public Criteria similarto(String attribute, String value) { 
     122    public Criteria similarto(String attribute, Object value) { 
    123123        criterionList.add(new Criterion(attribute, Criterion.OP_SIMILAR_TO, value)); 
    124124        return this; 
     
    128128     * Add a criterion where an attribue is greater than a value (SQL > operator) 
    129129     */ 
    130     public Criteria gt(String attribute, String value) { 
     130    public Criteria gt(String attribute, Object value) { 
    131131        criterionList.add(new Criterion(attribute, Criterion.OP_GREATER_THAN, value)); 
    132132        return this; 
     
    136136     * Add a criterion where an attribue is less than a value (SQL < operator) 
    137137     */ 
    138     public Criteria lt(String attribute, String value) { 
     138    public Criteria lt(String attribute, Object value) { 
    139139        criterionList.add(new Criterion(attribute, Criterion.OP_LESS_THAN, value)); 
    140140        return this; 
  • trunk/fmgVen/src/com/fmguler/ven/QueryGenerator.java

    r28 r32  
    3636    private Set domainPackages; 
    3737    private Set dbClasses; 
    38     private boolean debug = true; 
     38    private boolean debug = false; 
    3939 
    4040    public QueryGenerator() { 
     
    237237        domainPackages.add(domainPackage); 
    238238    } 
     239 
     240    /** 
     241     * Set debug mode, true will log all debug messages to System.out 
     242     * <p> 
     243     * Note: Use debug mode to detect problems only. It is not a general purpose logging mode. 
     244     * @param debug set true to enable debug mode 
     245     */ 
     246    public void setDebug(boolean debug) { 
     247        this.debug = debug; 
     248    } 
    239249} 
  • trunk/fmgVen/src/com/fmguler/ven/QueryMapper.java

    r28 r32  
    4545    private Set domainPackages; 
    4646    private Set dbClasses; 
    47     private boolean debug = true; 
     47    private boolean debug = false; 
    4848 
    4949    public QueryMapper() { 
     
    191191        domainPackages.add(domainPackage); 
    192192    } 
     193 
     194    /** 
     195     * Set debug mode, true will log all debug messages to System.out 
     196     * <p> 
     197     * Note: Use debug mode to detect problems only. It is not a general purpose logging mode. 
     198     * @param debug set true to enable debug mode 
     199     */ 
     200    public void setDebug(boolean debug) { 
     201        this.debug = debug; 
     202    } 
    193203} 
  • trunk/fmgVen/src/com/fmguler/ven/Ven.java

    r30 r32  
    3838    private QueryGenerator generator; 
    3939    private QueryMapper mapper; 
    40     private boolean debug = true; 
     40    private boolean debug = false; 
    4141 
    4242    public Ven() { 
     
    196196        return this; 
    197197    } 
     198 
     199    /** 
     200     * Set debug mode, true will log all debug messages to System.out 
     201     * <p> 
     202     * Note: Use debug mode to detect problems only. It is not a general purpose logging mode. 
     203     * @param debug set true to enable debug mode 
     204     */ 
     205    public void setDebug(boolean debug) { 
     206        this.debug = debug; 
     207        generator.setDebug(debug); 
     208        mapper.setDebug(debug); 
     209    } 
    198210} 
Note: See TracChangeset for help on using the changeset viewer.