Questions tagged [multi-mapping]

25 questions
1
vote
1 answer

Report on a multimap by producing a new map of each key mapped to the count of elements in its collection value

Imagine a multimap tracking persons, each of whom has a list of assigned tasks. Map< Person , List< Task > > personToTasks = Map.of( new Person( "Alice" ) , List.of( new Task( "a1" ), new Task( "a2") ) , new Person( "Bob" ) …
Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
1
vote
4 answers

Invert a Map with redundant values to produce a multimap

Given a map such as this where we have a frequency count per day-of-week for a year: Map.of( DayOfWeek.MONDAY , 52 , DayOfWeek.TUESDAY , 52 , DayOfWeek.WEDNESDAY, 53 , DayOfWeek.THURSDAY , 53 , DayOfWeek.FRIDAY , 52 , …
Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
1
vote
1 answer

Dapper Resolve Invalid cast exception

I am using Dapper with MySql to get a list of uTeacher with multi-mapping but I can't get it to work! I get Invalid Cast exception from Int32 to uDepartement class and other classes!! ( DataException: Error parsing column 33 (Department=1 - Int32)…
iProg
  • 13
  • 3
1
vote
0 answers

Using multiple index mapping in Elasticsearch

I`m using version 2.4.5 of elasticsearch(I need this version in project). I`ve the next lines of code: result = jestClient.execute(new PutMapping.Builder(indexName, Types.USER, userMappingSource).build()); ... result = jestClient.execute(new…
1
vote
2 answers

How do I return one-to-many records in a specific order with Dapper and multi-mapping?

From Github: Dapper allows you to map a single row to multiple objects. This is a key feature if you want to avoid extraneous querying and eager load associations. Example: Consider 2 classes: Post and User > class Post { > public int Id {…
johnny
  • 19,272
  • 52
  • 157
  • 259
1
vote
2 answers

Multimapping in Dapper Without Custom SQL

Is there a way to use multimapping in Dapper in a generic way, without using custom SQL embedded in C# code? See for example Correct use of Multimapping in Dapper Is there a generic way to query the data from 2 related entities, where common fields…
Miha
  • 303
  • 3
  • 19
1
vote
0 answers

Can Dapper load a Multi-Mapping result when a join table is in use?

I have an application object which has many connection objects. This is great in the .Net world but unfortunately the join is managed via a join table with a composite key. Is it possible to map this in dapper using a multi-mapping approach? For now…
Mark Redfern
  • 357
  • 1
  • 3
  • 24
0
votes
0 answers

Add elements from a 2d ArrayList to a multimap in java

I want to add elements from a 2D arraylist to a multimap but cant find an equivalent method to getOrDefault as in case of hashmaps. I tried using the guava library but seems like it does not have any deafult method for doing the same. can someone…
0
votes
2 answers

Dapper MultiMapping for 3 One-To-One relationships

I have 3 tables in Sql Server, one-to-one relationships. The key is Indice in all 3 tables. The 3 entities: public class Client { public int Indice { get; set; } public string Name { get; set; } public string Surname { get; set; } …
Kiquenet
  • 14,494
  • 35
  • 148
  • 243
-1
votes
1 answer

Dapper error when deserializing to complex object

I'm trying to convert a "flat" query into a complex object. The query returns custom_height and custom_width which I would like to be a child object off of the main Panel object being serialized. When I attempt to use splitOn to achieve this, I am…
Joe Phillips
  • 49,743
  • 32
  • 103
  • 159
1
2