Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8168521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:33:21+00:00 2026-06-06T20:33:21+00:00

I want to create a multi-module (maven) spring MVC application, with modules like: web

  • 0

I want to create a multi-module (maven) spring MVC application, with modules like:

web
persistance (hibernate)
core (general libs)
models
job-server (queue based jobs)
services (business logic)

Now to use Scala in this project, can I write scala everywhere without any problems?
Or should I use scala for my services module, and java for the web module?

I know hibernate will have to be in java.

Thoughts? Advice?

Are there any issues to look out for? Is this a good idea? Will I have to hack certain parts to glue them together?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:33:22+00:00Added an answer on June 6, 2026 at 8:33 pm

    Yes, you can use Scala for both your Spring MVC code and your Hibernate classes.

    Here is an example of a Spring MVC Controller in Scala taken from one of my projects:

    @Controller
    class HomeController {
      val log: Logger = LoggerFactory.getLogger(this.getClass.getName)
    
      @RequestMapping(Array("/"))
      def home: String = {
        log.debug("HomeController::home")
    
        "home/home"
      }
    }
    

    And an example of a Hibernate domain class. Note the use of private Java collection classes for Hibernate adapted by public Scala collection classes for users of the class (helped by Scala’s JavaConversions class).

    @Entity
    class Role {
      @Id @GeneratedValue
      var id: Long = _
    
      @Index(name="role_name")
      var name: String = _
    
      var created_at: Date = _
      var updated_at: Date = _  
    
      @ManyToMany
      private var sub_role: java.util.Set[Role] = _
      def subRoles: Set[Role] = {
        if (sub_role == null) sub_role = new java.util.HashSet[Role]
        sub_role
      }
    
      @ManyToMany
      private var permission: java.util.Set[Permission] = _
      def permissions: Set[Permission] = {
        if (permission == null) permission = new java.util.HashSet[Permission]
        permission
      }
    }
    

    The only thing I’ve found that I’ve had to use Java for is writing @Retention(RUNTIME) annotations (for JSR-303 validations).

    I use Maven and the maven-scala-plugin with mixed Java/Scala projects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi module maven web application, which uses hibernate. I use the
I want to create maven multi module project, but it should not like normal
I want to create a multi-tenant application that uses the hostname to determine the
I have a Java multi-module Maven project that I want to build an MVN
I want to create a multi platform application whose support all type of window
I have multi-thread application that I want to create a thread with different user
I want to make my first release of a multi-module maven project using the
I want to create a multi-user application, but I don't know how to save
I have a multi module web app building with maven. We build the war
I want to create a multi layered (3 layers) application. EF is the preferred

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.