开发者

Mapping Tool for generating domain classes

开发者 https://www.devze.com 2023-02-04 12:54 出处:网络
I am using a tool called dbmapper to generate domain classes. We have created our db in accordance with the rules required for this tool.This is my class

I am using a tool called dbmapper to generate domain classes. We have created our db in accordance with the rules required for this tool.This is my class

开发者_如何学编程
public class Test {
 public static void main(String args[]){
  GenerateConfig gc = new GenerateConfig();
  String driverClassName = "com.mysql.jdbc.Driver";
  String dbURL = "jdbc:mysql://localhost:3306/temp1";
  String username = "root";
  String password = "root";
  String destDirectory = "F:\\target";
  String type = "jpa";
  gc.setDriver(driverClassName);
  gc.setUrl(dbURL);
  gc.setUser(username);
  gc.setPassword(password);
  gc.setDestinationDirectory(destDirectory);
  gc.setType(type);
  Generator g = new Generator();
  g.setConfig(gc);
  try {
   g.generate();
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
}

When I run this class I get the following exception.

org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'com/moonspider/dbmap/jpa.template'

I have the necessary jar files in my classpath. I also tried using a couple of ResourceLoader implementations but igt the same error.

Could somebody help me here?

Thanks


It seems that you are missing a file called jpa.template under your source package com/moonspider/dbmap.

0

精彩评论

暂无评论...
验证码 换一张
取 消