Skip to content

Conversation

@imranzahid01
Copy link

Rather than using snow.properties I have modified the code to use hibernate.cfg.xml
This enables IDE (like IntelliJ IDEA) to understand the persistence use. Plus there is no need to define in multiple places the properties related to hibernate. Keeps both frameworks separate.

@@ -91,6 +94,18 @@ protected ApplicationLoader load(Map<String,String> overrideProperties, Module..
appProperties.put(key, overrideProperties.get(key));
}
}

boolean hasHibernate = false;
String hibernateFileProperty = appProperties.get("snow.hibernate.configuration");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In snow.properties file one can add the following line:
snow.hibernate.configuration=hibernate.cfg.xml
and the hibernate.cfg.xml can be anywhere in the classpath

@jeremychone
Copy link
Contributor

Hi, this is interesting I think it is a good idea to add such support, but I would like to use this opportunity to decouple Hibernate from Snow internals.

Originally I put Hibernate in Snow for convenience, but I think it is not very clean the way Hibernate is known from the internal. A while back, I added WebApplicationHook and WebRequestHook, which I was designed to be a clean way for the Hibernate "module" to hook itself into Snow.

So, for this requirement, I am offering to update the way the hibernate snow module integrate to Snow so that it is easier to customize without changing Snow source.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants