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 7923675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:23:57+00:00 2026-06-03T17:23:57+00:00

I have two classes in a database, and wish to set up a one

  • 0

I have two classes in a database, and wish to set up a one to many relation. Nothing complicated. However, I’m getting an assertion failure in squeryl’s _splitEquality (on line 576). Squeryl is version 0.9.5

So I have a schema

object Tables extends Schema {
val foo = table[Foo]("foo_table")
val bar = table[Bar]("bar_table")

val fooBar = oneToManyRelation(foo,bar).via((f,b) => f.id === bar.foo_fk)
}

Where foo is

 class Foo (val foo_id: String, val useful_info: String) 
   extends KeyedEntity[String] {
 override def id: String = foo_id
 }

and bar is

class bar (val foo_fk) {
def useful_info = Tables.fooBar.right(this).head.useful_info
}

However, this fails at runtime with the previously mentioned assertion failure, specifically that:
assert(ee.right._fieldMetaData.isIdFieldOfKeyedEntity)
fails

  • 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-03T17:23:58+00:00Added an answer on June 3, 2026 at 5:23 pm

    I fixed it by using a column annotation on Foo instead of overriding id.
    So foo became

    class Foo (
    @Column("foo_id")
    val id: String, 
    val useful_info: String) 
      extends KeyedEntity[String] {
    }
    

    I’m not totally sure why this worked, but I’m annoyed that it did.

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

Sidebar

Related Questions

I have two PHP classes. One is for connecting to the database, building queries,
I have two classes that represent two different database entities. Their relationship is 1:m
I have two classes one of which inherits from the other. Im trying to
I have two classes: public class RichMan { public string ID {get;set;} List<Car> _cars=new
I was wondering if you could help me out.. I have two classes, one
I have two classes: public class Foo { public int FooId {get;set;} public virtual
I have two classes, Database and User. In the Database class I have function
I have two classes. I want to map Class1 to a database table with
I have two classes: class Foo{ public int FooId { get; set; } ...
I have two classes. One is Order: public class Order { public virtual int

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.