|
Java ReferenceDefining custom entity classesYou can easily use a custom instance class for an entity. All you have to do is to specify its full qualified name in the 'class' attribute of the target entity in the configuration file. The class can be a POJO (Plain Old Java Object). You can then decide to declare some of the getters or setters, or one of the insert(), update() or delete() methods if you want to specialize them, for instance to include some specific validation code. It is also allowed to have your class inherit from
Standalone usageIf you are not using the velocity-tools project, you can easily populate a Velocity context with a code as simple as this one:
Some remarks, thought:
Alternatively, you can handle yourself the initialization process:
JavadocYou can build the javadoc using the 'javadoc' ant target. Using Velosurf from within JavaVelosurf can be used from Java as easily as from VTL. It can be more convenient than using the jdbc classes and methods, especially if you want to re-use from Java the attributes you have defined in velosurf.xml. Please note that to avoid sql connection timeouts, you should not declare Velosurf prepared statements as variables having a long lifecycle (like static members). You should only keep references to Velosurf connection objets on the long term (they do handle timeouts). |