1

If lazy='false' is for defining the one to many relationship. What is the purpose of bag. What makes them differ.

Vaishali
  • 117
  • 1
  • 2
  • 9

2 Answers2

0

Lazy is weather lazy loading is enabled for the given collection, if enabled (true) then it will only load the list only when it's accessed.

About the second question, bag is a collection type and see this question for more information

Community
  • 1
  • 1
Low Flying Pelican
  • 5,974
  • 1
  • 32
  • 43
  • What happens actually on setting lazy loading as false or true. Is there any problem or benefit in setting the those values – Vaishali Jun 25 '16 at 06:21
  • Setting lazy=true will not load related entities, which would reduce number of queries to the database and it's an advantage. – Low Flying Pelican Jun 25 '16 at 10:46
0

Lazy have bool type. If you have set Lazy value is false then that property load data while class is used in operation or not. But when you set true that is load data while you can access this property.

So in my opinion you should set true for faster load data.

Kalu Singh Rao
  • 1,671
  • 1
  • 16
  • 21