• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the use of VM file?

 
Fidel Edwards
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Members,

I was working on a project where I saw some VM files for generating classes having some code like



However in Java files which are generated from this VM file has almost the same code style. So can any one explain me how VM file works?

I found one document in this support but could not able to understand.

Thanks in advance !



 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks as if the Apache Velocity templating library is being used to generate Java source code.
 
Fidel Edwards
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:That looks as if the Apache Velocity templating library is being used to generate Java source code.


In fact it is swing based client/server project. I talked with a developer for the same he told me earlier these files being used for developing some mapping between java file and database. Now all the newly developed module is using hibernate for the same.

I tried to create a new getter/setter in the older code. Developer told me just create abstract getter and setter method in abstract class. And then try to generate the Implementation class via rant export command.

I don't know but I see some ruby.... something.. something.. on console. I am totally discombobulated
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HibernateTools may use Velocity templates for codegen (it's either that or FreeMarker, I forget which).

Rant is a Ruby-based makefile system.
 
Rob Spoor
Sheriff
Pie
Posts: 20659
64
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:That looks as if the Apache Velocity templating library is being used to generate Java source code.

As someone who has worked with Velocity as recently as today I concur - this looks like a Velocity template file.
 
Fidel Edwards
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:
Ulf Dittmer wrote:That looks as if the Apache Velocity templating library is being used to generate Java source code.

As someone who has worked with Velocity as recently as today I concur - this looks like a Velocity template file.


But what I am seeing this project is using these files as generator for java files.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fidel Edwards wrote:But what I am seeing this project is using these files as generator for java files.

What do you mean, "but"? Aren't you saying the exact same thing as Rob and I before?
 
Fidel Edwards
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:
What do you mean, "but"? Aren't you saying the exact same thing as Rob and I before?


Sorry for restating the things. If I get any tutorial or example then that will be really helpful.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fidel Edwards wrote:But what I am seeing this project is using these files as generator for java files.

That's correct--they are.

What, precisely, do you want a tutorial on? Velocity? Check the Velocity website and get the docs for your version. HibernateTools (if that's what's being used)? The Hibernate docs have some information about that and the reveng file.
 
Fidel Edwards
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:
Check the Velocity website and get the docs for your version. HibernateTools (if that's what's being used)? The Hibernate docs have some information about that and the reveng file.


Thanks David!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic