# Null components and null elements in a collection of records # Hibernate ORM 7.4.17.Final, H2 2.4.240, JDK 25 -- Set: add Tag(java, null) sql> insert into Article (id) values (?) sql> insert into Article_tagSet (Article_id,name,colour) values (?,?,?) => added rows: [1 | null | java] -- Set: add Tag(null, null) sql> select a1_0.id from Article a1_0 where a1_0.id=? sql> select ts1_0.Article_id,ts1_0.name,ts1_0.colour from Article_tagSet ts1_0 where ts1_0.Article_id=? sql> delete from Article_tagSet where Article_id=? sql> insert into Article_tagSet (Article_id,name,colour) values (?,?,?) sql> insert into Article_tagSet (Article_id,name,colour) values (?,?,?) => added rows: [1 | null | null, 1 | null | java] -- List (bag): add Tag(null, null) sql> select a1_0.id from Article a1_0 where a1_0.id=? sql> select tb1_0.Article_id,tb1_0.name,tb1_0.colour from Article_tagBag tb1_0 where tb1_0.Article_id=? sql> insert into Article_tagBag (Article_id,name,colour) values (?,?,?) => added rows: [1 | null | null] -- load tagBag sql> select a1_0.id from Article a1_0 where a1_0.id=? sql> select tb1_0.Article_id,tb1_0.name,tb1_0.colour from Article_tagBag tb1_0 where tb1_0.Article_id=? => [] (what a reader of the collection gets back) -- List (bag): add a null element sql> select a1_0.id from Article a1_0 where a1_0.id=? sql> select tb1_0.Article_id,tb1_0.name,tb1_0.colour from Article_tagBag tb1_0 where tb1_0.Article_id=? => added rows: [1 | null | null]