mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +00:00
#919 - io.ebean package initial
This commit is contained in:
1 parent
5821dc96b9
commit
971e2dc91b
2134 files changed
+10721
-8652
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package io.ebeaninternal.server.persist;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* Used to sort BatchedBeanHolder by their depth.
|
||||
* <p>
|
||||
* Beans are queued and put into BatchedBeanHolder along with their depth. This
|
||||
* delays the actually binding to PreparedStatements until the
|
||||
* BatchedBeanHolder's are flushed. This is so that we can get the generated
|
||||
* keys from inserts. These values are required to persist the 'detail' beans.
|
||||
* </p>
|
||||
*/
|
||||
public class BatchDepthComparator implements Comparator<BatchedBeanHolder>, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 264611821665757991L;
|
||||
|
||||
public int compare(BatchedBeanHolder b1, BatchedBeanHolder b2) {
|
||||
|
||||
if (b1.getOrder() < b2.getOrder()) {
|
||||
return -1;
|
||||
}
|
||||
if (b1.getOrder() == b2.getOrder()) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user