empire-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis De Brabandere <franci...@gmail.com>
Subject Re: Are there any docs covering the CodeGenWriter
Date Wed, 18 Apr 2012 10:09:22 GMT
Hi Rit?

At this time there is no documentation but the codegen example (maven)
mvn empiredb:codegen

CodeGenMojo.java (in the maven plugin module) explains how to use the
codegenerator programatically:

CodeGenConfig config = new CodeGenConfig();
		if(configFile != null)
		{
			getLog().info("Loading configuration file: " + configFile);
			config.init(configFile.getAbsolutePath());
		}
		else
		{
			config.setJdbcURL(jdbcURL);
			config.setJdbcClass(jdbcClass);
			config.setJdbcUser(jdbcUser);
			config.setJdbcPwd(jdbcPwd);
			config.setTargetFolder(targetDirectory.getAbsolutePath());
			config.setTemplateFolder(templateDirectory);
			config.setPackageName(packageName);
		}
		
		//config.setExceptionsEnabled(true);
		
		getLog().info("Generating code for " + jdbcURL + " ...");
		
		CodeGenParser parser = new CodeGenParser(config);
		DBDatabase db = parser.loadDbModel();
		
		CodeGenWriter codeGen = new CodeGenWriter(config);
		codeGen.generateCodeFiles(db);


I hope this helps,
Francis

On 17 April 2012 22:14, rit@pm-mail.co.uk <rit@pm-mail.co.uk> wrote:
> I'm starting from scratch when it comes to empiredb, so am not to clear on
> how everything hangs together. Is there a doc covering how to use the
> codegen module so that I can convert a current schema into code.
>
>
>
> Thanks

Mime
View raw message