What have you written so far? Remember JavaRanch is
NotACodeMill. And remember, as I said before, Hibernate is open source and will contain a wealth of examples. Writing a generator is fairly simple, there is only one method to implement and you can implement it however you like.