All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.beangle.webmvc.hibernate.action.AbstractAction.scala Maven / Gradle / Ivy

There is a newer version: 0.2.7
Show newest version
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