Menu

Object Factory

Help
Hamvil
2008-01-11
2013-04-25
  • Hamvil

    Hamvil - 2008-01-11

    Hi,

    I'm trying to run sql2java over my usual db schema. However the final code contains some classes named:

    TABLEFactory

    Moreore it seems to me that such classes require sql2java.jar in the classpath. Am I right?

    What is the typical use of this class? I tried to find some documentation but with no luck.

    Thanks
    R.

     
    • linovski

      linovski - 2008-01-11

      No. You just need sql2java for generate the code for the database access.

      For example, here sql2java-2-6-6/src/templates/velocity/factory/pertable/factory.java.vm you can preview what you will got in the final code.

      The templates to be used are here:
      sql2java-2-6-6/src/templates/velocity

      In the file sql2java-2-6-6/src/config/sql2java.properties
      you can set the fowling propertie

      template.folder.include=java db

      In this example the templates java and the will be used.

      Did I answer in some way, to your question?

       
    • Hamvil

      Hamvil - 2008-01-12

      Thanks, got it.

      Now I'm using:

      template.folder.include=java db 

      is there a way to avoid generating the html documentation for the schema (the web subdirectory)?

       
    • Alain Fagot Béarez

      The templates are more or less organized by "features".  Each feature generates a couple of files, either once for each schema, either one for each table.  Each feature is thus organized in two directories: perschema and pertable.

      The currently available features are
      - java : Java 1.4 classes for managing the CRUD operations
      - java5 : Java 5 classes (equivalents to the preceeding ones)
      - db : HTML and graphviz documentation
      - cache : a simple cache implementation (if you are not already using some better solution)
      - factory : a factory mechanism (requiring the sql2java-validator-0.1.jar, no sources)
      - spdao : data access objects based on stored procedures (experimental)
      - ibatis : classes for integration in the iBatis framework (experimental)
      - appfuse : application framework based on Hibernate persistence (experimental)
      - web : dynamic database documentation as webapp (experimental)

      You can select one or more features through the template.folder.include property (java and java5 should be used in an exclusive way).

      For example:

      template.folder.include = java cache db

      would generate the Java 1.4 classes, the simple cache and the database documentation.

      Generating only the Java 5 classes is done by:

      template.folder.include = java5

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.