I have a JPA object similar to;
public class Inventory { private String productname; private String manufacturer; private Float retailprice; private Integer unitssold; private String ourcomment; }
In about 2 out of 5 queries, I need the whole object, but the rest of the time I'm not interested in units and our comment.
It looks like a waste to make a request and get a large list of results, but only 3/5 of the information. I would like to optimize this a bit, and I have a hunch that this can be done using inheritance.
But how?
Inheritance? No.
, , , Inventory , , , ( , ) - .
Inventory
, 4- 5- ""; JPA -, :
@Basic(fetch = FetchType.LAZY) private Integer unitssold; @Basic(fetch = FetchType.LAZY) private String ourcomment;
fetch all properties , ; .
fetch all properties
, , , "" (, Integer; String , )
Integer
String
, , .
Source: https://habr.com/ru/post/1716533/More articles:Subsonic 3.0.0.3 SQL Paging Using Linq - linqAsp.net Mvc: nullable filter parameter - nullableiostream user data - c ++Problem using log4j with 2 axis - log4jCould ARM9 Prefetch Abort Exception be a software issue? - armiPhone Push Notifications Custom sound, no vibration in silent mode? - iphoneHow to make a jQuery click event affect only an element nested in the same parent element - jqueryWhat is the correct way to set ANT_OPTS on OS X? - javaRuby Lock IO.read ()? - ruby ββ| fooobar.comType Limit in Discrimination Union - f #All Articles