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

  • Home
  • SEARCH
  • 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 7761587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:10:26+00:00 2026-06-01T14:10:26+00:00

Running a Squeryl call for some data that pulls from multiple locations, but for

  • 0

Running a Squeryl call for some data that pulls from multiple locations, but for some reason it returns as a unit. How do I get it to return as an Iterable?

Below is pulling of the data:

/**
   * gets a stream for a particular user
   */
  def getUserStream(userId:Long) {
    User.teamIds(userId).toList.map( (team) =>
      Stream.findByTeam(team,0,5).map( (stream) => 
        List(stream)
      ).flatten
    ).flatten.sortBy(_.id)
  }

And then outputting the data, where results returns as Unit:

Stream.getUserStream(userId) match {
      case results => {
        Ok( generate(results.map( (stream) => Map(
                "id" -> stream.id,
                "model" -> stream.model,
                "time" -> stream.time,
                "content" -> stream.content
                ))
            ) ).as("application/json")
      }
      case _ => Ok("")
    }

My initial guess is one function could return as a None, but wouldn’t it just return an empty list?

  • 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-01T14:10:28+00:00Added an answer on June 1, 2026 at 2:10 pm

    You missing the equal sign before you def getUserStream(userId:Long) method body.

    def func(x: Int) { x + 1 } // This will return Unit
    def func(x: Int) = { x + 1 } // This will return a Int
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running into a problem where on certain servers we get an error that the
Running the following vbscript to call svnadmin dump fails (i.e. no dump is being
Running the following code, I get a StackOverflowError at the getPackage() line. How can
Running an MVC web site that calls a WCF service. Site and service on
Running my play framework small app I get the following exception: ... Caused by:
running: ruby 1.9.3p0 with Rails 3.2.1 Trying to use rspec but when I try
Running Linux (Ubuntu 11.10), the same regular expression works in JavaScript, but fails when
Running an iOS simulator, is there any way to get information related to memory
running git instaweb in my repository opens a page that says 403 Forbidden -
Running FxCop on my code, I get this warning: Microsoft.Maintainability : 'FooBar.ctor is coupled

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.