• Post Reply Bookmark Topic Watch Topic
  • New Topic

Anotation instead hbm file

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we use annotation for instead hbm file is is ok to use bean class with main method and inside main method saving bean object?
 
sam liya
Ranch Hand
Posts: 1246
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding Records URL

You can put a main method anywhere, but you probably want the code that runs your application outside of any POJO if you're going to production. For testing and tutorials it's just fine.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!