org.beangle.webmvc.hibernate.action.AbstractAction.scala Maven / Gradle / Ivy
package org.beangle.webmvc.hibernate.action
import org.beangle.commons.lang.Strings.isEmpty
import org.beangle.data.jpa.hibernate.ConfigurableSessionFactory
import org.beangle.webmvc.api.action.ActionSupport
import org.beangle.webmvc.hibernate.helper.SessionFactoryHelper
import org.hibernate.SessionFactory
abstract class AbstractAction extends ActionSupport {
var helper: SessionFactoryHelper = _
def getSessionFactory(): SessionFactory = {
val sfid = get("session_factory_id", "")
if (isEmpty(sfid)) return null
else helper.getSessionFactory(sfid)
}
def getFactory(): ConfigurableSessionFactory = {
val sfid = get("session_factory_id", "")
if (isEmpty(sfid)) return null
else helper.getFactory(sfid)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy