Could not find or construct Composite[com.SomeCaseClass] when adding any simple type to a case class with over 35 parameters.
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 2.2k
- Forks
- 379
- Avg merge
- 14m
- Merged PRs (30d)
- 8
Description
I have a case class for mapping rows that contains 43 fields. When I remove the last few fields so the case class only has 35 the error below goes away. When I add a 36th field to the case class with the same simple type as the 35th (Int or Option[Int] for example) the following error surfaces.
Could not find or construct Composite[com.SomeCaseClass].
If com.SomeCaseClass is a simple type (or option thereof) that maps to a single column, you're probably missing a Meta instance. If com.SomeCaseClass is a product type (typically a case class, tuple, or HList) then probably one of its component types is missing a Composite instance. You can usually diagnose this by evaluating Composite[Foo] for each element Foo of the product type in question.
Do I need to create a custom mapping or Meta instance for case classes over 35 fields?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported Composite derivation failure with a case class containing 35 fields, then add a 36th Int or Option[Int] field. Trace the Composite entry point mentioned in the report and determine whether the behavior is a bug or an arity limitation. Done means the larger case class maps successfully or the required custom mapping is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100