lazy-loading

JPA + EclipseLink - Lazy Loading with closed EntityManager

守給你的承諾、 提交于 2019-12-24 11:37:32
问题 I'm using EclipseLink as JPA provider in a Java SE project. I have properly configured the weaving to allow the Lazy Loading. Unlike Hibernate (which throws LazyInitializationException), EclipseLink can get a proxy of LAZY relationship, even with a closed EntityManager. To run this query, it gets a new connection from the pool. Is there some setting that disables or changes the behavior of this feature? I need to get a null value or an exception when trying to access an unloaded attribute,

PrimeNG set the page for the first using lazy loading table

谁都会走 提交于 2019-12-24 11:35:53
问题 I'm using component p-table with "Paginator" and "Lazy loading", and I made one search component with what I need. I am trying to fix the problem when I filter and the page index is on another page. example: page index = 2 Filtering text = texto. Then, I update the records on table and the quantity of pages. But the page index continues with 2, if the result has more or equal quantity of index pages. I've try changing the value from Event but it does not apply. Documentation PrimeNG lazy

Lazy loading of the content

和自甴很熟 提交于 2019-12-24 11:27:03
问题 I have two entities : User and Post (relation one-to-many). Post fields: id , creationDate , title , content , user . Data is stored in the database and accessed via Hibernate. I have a controller to pass Post object as a JSON to JavaScript. Then it is shown on the web page. But it is not always necessary to pass all the Post fields. For ex., I need to show to the user only title and creation date, and if the user presses the button Show content , only then I need to show post content (which

Entity framework 6 Lazy loading with db initiation

半腔热情 提交于 2019-12-24 09:35:29
问题 I am working with EF 6 and Lazy loading. class MainPrograme { static void Main(string[] args) { ProgramContext _dbContext = new ProgramContext(); _dbContext.Programs.Add(new Program { SecondProgram = new SecondProgram { Title = "Demo" } }); _dbContext.SaveChanges(); var item = _dbContext.Programs.Find(1); } } Once I disable lazy loading with Configuration.LazyLoadingEnabled = false; It works fine. No relational objects are loaded. item.SecondProgram is null . Perfect. However when I delete

Angular 2 - Wait for data init from service

拈花ヽ惹草 提交于 2019-12-24 09:35:25
问题 There are 2 services: DataService - gets data from the server CacheService - subscribes to DataService and holds mapped data and component ComponentA - Injects CacheService and has foo function that handles cached data My question is - How do I ensure that my CacheService is done with data when my foo function gets called . Current solution that I kinda like but am not sure if there isn't some better Angular 2 way. Done with Rx.Observables My solution (Code is simplified): export class

Lazy loading - Providers and modules

风格不统一 提交于 2019-12-24 08:09:04
问题 I'm moving my app to lazy loading. I'm done with pages, pipes and directives but now it's the turn of providers/services and some other modules. This was my app.module : ... import { FileUploadModule } from "ng2-file-upload"; import { CloudinaryModule } from "@cloudinary/angular-5.x"; import * as cloudinary from "cloudinary-core"; import { ImageUploadProvider } from "../services/image-upload/image-upload"; ... imports: [ ... FileUploadModule, CloudinaryModule.forRoot(cloudinary, { cloud_name:

EF CTP4 lazy loading not playing ball

旧时模样 提交于 2019-12-24 07:03:19
问题 I'm using the CTP4 code first EF framework, but I'm having problems getting lazy loading to work. Reading up on it, it should be simple, but it's just not public class Folder { public int Id { get; set; } public string Name { get; set; } public int? ParentFolderId { get; set; } public virtual IList<Folder> ChildFolders { get; set; } } In the model configuration: HasMany(f => f.ChildFolders).WithOptional().HasConstraint((child, folder) => child.ParentFolderId == folder.Id); However, when I do

Reloading navigation properties after detaching a new object

≡放荡痞女 提交于 2019-12-24 05:52:58
问题 I am using Entity Framework with POCO objects and have the following scenario: I create a new parent object and add a child object to it. Then I save changes and detach the parent object. At this moment its children collection gets empty. parent = new Parent() { label = "Test" }; parent.Children.Add(new Child() { label = "Test" }); context.Parents.AddObject(parent); context.SaveChanges(); context.Detach(parent); When I reattach the parent object to a different context, I have to explicitly

Does SDWebImage support “not-when-fast-scrolling” (skimming) for lazy loading?

萝らか妹 提交于 2019-12-24 04:42:08
问题 When doing lazy loading (table of UICollectionView), for a correct result, you should NOT begin downloads, when the user is scrolling very quickly over the collection. So, imagine a vertical scroll with 200 panels each with an image; four or five are seen onscreen at a time. When it first loads, the first 4 visible images should begin loading. If you scroll down a little, the newly visible images should begin to load. BUT if the user: very quickly scrolls down to (say) position 100 and then

amp-img not showing in carousel

本小妞迷上赌 提交于 2019-12-24 01:15:43
问题 I used an AMP carousel to show a list of articles abstracts. For some reason only the abstracts which were visible at page load have pictures. ( If i rotate the screen more but not all pictures are loaded. ) What am i doing wrong? Feel free to ask for more info. Here's the layout: <amp-carousel class="articles-carousel" layout="fixed-height" height="200" type="carousel"> <article role="button" tabindex="1" class="article-abstract" on="tap:AMP.setState({selectedArticle:1072}),AMP.scrollTo('id'