概述 检索数据时的2个问题:不浪费内存:当Hibernate从数据库中加载Customer对象时,如果同时加载所有关联的Order对象,而程序实际上仅仅需要访问Customer对象,那么那些关联的Order对象就白白浪费了许多内存更好的查询效率:发送尽可能少的SQL语句Hibernate的检索策略....
分类:
Web程序 时间:
2014-11-30 15:29:18
阅读次数:
148
单表select a.id from a where type=1 order by idforeach 组合成 (20,3,69)形式select a.title,a.id from a in(组合形式)id 铸件索引 type普通索引多表select a.cid,b,id from a inne...
分类:
其他好文 时间:
2014-11-30 13:56:42
阅读次数:
149
Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.这题思路参照Conve...
分类:
其他好文 时间:
2014-11-29 20:07:35
阅读次数:
178
是这题的变种对一棵树从最后一次开始层次遍历,并返回结果。例如:Given binary tree{3,9,20,#,#,15,7}, 3 / \ 9 20 / \ 15 7return its bottom-up level order traversal as:[ ...
分类:
其他好文 时间:
2014-11-29 15:57:28
阅读次数:
251
function array_sort($arr ,$keys,$order=0){ if(!is_array($arr)){ return false; } $keysvalue=array(); foreach ($arr as $key=>$val){ $keysvalue[$key]=...
分类:
编程语言 时间:
2014-11-29 15:44:11
阅读次数:
130
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat...
分类:
其他好文 时间:
2014-11-29 10:12:55
阅读次数:
167
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree {3...
分类:
其他好文 时间:
2014-11-29 07:06:01
阅读次数:
191
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:
其他好文 时间:
2014-11-29 06:59:16
阅读次数:
153
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and ...
分类:
其他好文 时间:
2014-11-29 06:40:34
阅读次数:
167
Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh...
分类:
编程语言 时间:
2014-11-28 21:17:07
阅读次数:
353