Questions tagged [fetching-strategy]

78 questions
3
votes
1 answer

NHibernate AliasToBeanResultTransformer & Collections

I would like to return a DTO from my data layer which would also contain child collections...such as this: Audio - Title - Description - Filename - Tags - TagName - Comments - PersonName - CommentText Here is a basic query so…
Paul Hinett
  • 1,951
  • 2
  • 26
  • 40
3
votes
1 answer

Fetching strategy encapsulation for Entity Framework 4.1 and NHibernate

I created a project to test out NHibernate 3+ vs. Entity Framework 4.1, wrapping it in a repository, making it very testable using interfaces etc. I do not want to expose either ORM outside of the repositories (I do not even expose IQueryables). …
3
votes
1 answer

Disabling Hibernate's recursive fetch

Current stack: Spring Boot 1.5.1 Spring Data JPA 1.11.0 Hibernate Core 5.2.6 Let's say we have the following @Entity structure @Entity class Root { @Id private Long id; @OneToMany @JoinColumn(name = "root_id") private…
rorschach
  • 2,871
  • 1
  • 17
  • 20
3
votes
2 answers

SetFetchMode call ignored

I have a problem with SetFetchMode call in Criteria API in following query: DetachedCriteria.For() .Add(u => u.Status == UserStatus.Live) .CreateAlias("UniqueId", "uid") …
Sly
  • 15,046
  • 12
  • 60
  • 89
3
votes
4 answers

CascadeType vs FetchType

I would like to now what is the difference between CascadeType and FetchType in Hibernate? They seem very similar but I guess they are not interchangeable, right? When to use them? Can they be used both at the same time?
jarosik
  • 4,136
  • 10
  • 36
  • 53
2
votes
1 answer

Join two data tables from different source databases in .NET?

How do you join two data tables from different source databases in .NET? Ideally, I can craft two queries manually and simply join on a single field. In this case, linked servers and scheduled imports are not an option. I've looked into the data…
Marc
2
votes
2 answers

Hibernate ignores FetchType for Single Inheritance

I have 3 entities inheriting from another entity. I'm using the strategy Single_Table @Inheritance(strategy = InheritanceType.SINGLE_TABLE) E.g. Class B,C and D inherite from A On entity B I'm loading another entity X eagerly. Unfortunately,…
Daniel
  • 834
  • 1
  • 9
  • 25
2
votes
1 answer

Fetch the smallest date of an object in CoreData

I'm having the same problem as this question, but the answer of @davedelong is not working for me. When following the Apple Example, for fetching the smallest date in a set of object I get the following error -[NSDate count]: unrecognized selector…
gcamp
  • 14,622
  • 4
  • 54
  • 85
2
votes
2 answers

Grails automatic relational fetching

Is is possible to do automatic relation fetching in GORM / Grails? class Person { static hasMany = [cars : Car] } class Car { static belongsTo = [owner : Person] } Then use this relation like: person = Person.get(1); person.cars.each() {…
Josh K
  • 28,364
  • 20
  • 86
  • 132
2
votes
2 answers

How to set NHibernate Linq fetch strategy through a façade layer

I’m using NHibernate for data access, but accessing it through a façade layer. This layer consists of interfaces for the repositories, plus an IUnitOfWork interface which corresponds to the ISession object. In order that retrieved entities are…
David
  • 15,750
  • 22
  • 90
  • 150
2
votes
4 answers

Hibernate fetching in criteria ignored

I have some class User which has one to many relation to LoginSession class (I have a collection of LoginSessions in my User class). @Entity(name="T_User") public class User() { .... @OneToMany(fetch=FetchType.LAZY, mappedBy="user",…
vlio20
  • 8,955
  • 18
  • 95
  • 180
2
votes
0 answers

NHibernate: is there limitation of batch-size to 10 items?

I am having a problem with NHibernate (SQL Server 2000, if it matters). It seems like NHibernate uses batch-size equal to 10 even if I specify 500 (but if I specify size less than 10, say 3 - it uses 3)
Konstantin Spirin
  • 20,609
  • 15
  • 72
  • 90
2
votes
1 answer

How to change hibernate's default fetching strategy?

I know hibernate's default fetching strategy is LAZY for collections, is there a way to change the default fetching strategy system wide through configuration file?
nimcap
  • 10,062
  • 15
  • 61
  • 69
1
vote
1 answer

What is a Fetching Strategy?

I understand the core concept of retrieving data using different strategies. But I cannot find a good summary/definition.. Is it a design pattern? Does it fit within a broader design pattern? Is it specific to ORM implementations? (Hibernate comes…
DaveO
  • 1,909
  • 4
  • 33
  • 63
1
vote
2 answers

Get eagerly collection of entities containing other eagerly got collections

I've got stuck on the M:N relation between entity and strings. An user can have more than one role and each role can be assigned to more than one user. Role is just a string. Roles are contained in table with two columns: roleId and roleName. I've…
Theodor Keinstein
  • 1,653
  • 2
  • 26
  • 47