You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am using Spring Data R2DBC and I found that the mapping "feature" that I used for one-to-one connections stopped working.
For example
createtableusers (id uuid not nullprimary key, username varchar(50) not null);
createtableusers_descriptions (user_id uuid not nullprimary key, name varchar(100) not null, phone varchar(13));
Entities
@Table("users")
data classUserEntity(valusername:String, @Id valid:UUID = UUID.randomUUID())
@Table("users_descriptions")
data classUserDescriptionEntity(valname:String, valphone:String, @Id valuserId:UUID)
data classUserWithDescriptionEntity(valusername:String, valdescription:UserDescriptionEntity, valid:UUID)
Repo
@Repository
interfaceUserRepository: ReactiveCrudRepository<UserEntity, UUID> {
@Query("SELECT u.*, ud.user_id as description_user_id, ud.name as description_name, "+"ud.phone as description_phone LEFT OUTER JOIN users_descriptions ud on ud.user_id = u.id")
fun <T> findAllExtended(type:Class<T>): Flux<T>
}
After this commit automatic mapping nested entity in that way stopped working.
As far as I understand, the readEntityFrom function takes the current field from the parent Entity as a prefix and further searches by Row using this prefix for the fields of the nested Entity, but now this function is not called if name of Entity field is not found in the metadata
I already found the workaround - just add something like this to the sql select statement true as description, but maybe it should work differently?
The text was updated successfully, but these errors were encountered:
Nested entities were never intended to work because we do not yet have proper fetching strategies in place. We are working towards a solution, but for the time being, closing this one.
Hello, I am using Spring Data R2DBC and I found that the mapping "feature" that I used for one-to-one connections stopped working.
For example
Entities
Repo
Usage
After this commit automatic mapping nested entity in that way stopped working.
As far as I understand, the readEntityFrom function takes the current field from the parent Entity as a prefix and further searches by Row using this prefix for the fields of the nested Entity, but now this function is not called if name of Entity field is not found in the metadata
I already found the workaround - just add something like this to the sql select statement
true as description
, but maybe it should work differently?The text was updated successfully, but these errors were encountered: