protected <T extends RawEntity<K>, K> T peer(EntityInfo<T, K> entityInfo, K key) throws SQLException { if (null == key) { return null; } return peer(entityInfo, toArray(key))[0]; }
protected <T extends RawEntity<K>, K> T peer(EntityInfo<T, K> entityInfo, K key) throws SQLException { if (null == key) { return null; } return peer(entityInfo, toArray(key))[0]; }
public static <T extends RawEntity<K>, K> T createPeer(EntityManager manager, Class<T> type, K key) throws SQLException { return manager.peer(manager.resolveEntityInfo(type), key); }
public static <T extends RawEntity<K>, K> T createPeer(EntityManager manager, Class<T> type, K key) throws SQLException { return manager.peer(manager.resolveEntityInfo(type), key); }
while (res.next()) { final Object returnValue = Common.getPrimaryKeyType(getTypeManager(), (Class) remoteType).getLogicalType().pullFromDatabase(manager, res, (Class) remoteType, remotePrimaryKeyFieldName); final RawEntity<?> returnValueEntity = manager.peer(entityInfo, returnValue); final EntityProxy<?, ?> proxy = manager.getProxyForEntity(returnValueEntity); if (selectFields.remove(Preload.ALL)) {
back.add(peer(entityInfo, entityInfo.getPrimaryKey().getTypeInfo().getLogicalType().pullFromDatabase(this, res, (Class<K>) type, keyField)));
back.add(peer(entityInfo, entityInfo.getPrimaryKey().getTypeInfo().getLogicalType().pullFromDatabase(this, res, (Class<K>) type, keyField)));
continue; final V returnValueEntity = manager.peer(manager.resolveEntityInfo(backType), returnValue); final EntityProxy<?, ?> proxy = manager.getProxyForEntity(returnValueEntity); if (selectFields.contains(Preload.ALL)) {
value = manager.peer(remoteEntityInfo, value);
while (res.next()) { final Object returnValue = Common.getPrimaryKeyType(getTypeManager(), (Class) remoteType).getLogicalType().pullFromDatabase(manager, res, (Class) remoteType, remotePrimaryKeyFieldName); final RawEntity<?> returnValueEntity = manager.peer(entityInfo, returnValue); final EntityProxy<?, ?> proxy = manager.getProxyForEntity(returnValueEntity); if (selectFields.remove(Preload.ALL)) {
try { if (res.next()) { final RawEntity returnValueEntity = manager.peer(entityInfo, Common.getPrimaryKeyType(getTypeManager(), (Class<? extends RawEntity<K>>) remoteType).getLogicalType().pullFromDatabase(manager, res, (Class<K>) remoteType, remotePrimaryKeyFieldName)); if (selectFields.remove(Preload.ALL)) { selectFields.addAll(entityInfo.getFieldNames());
value = manager.peer(remoteEntityInfo, value);
continue; final V returnValueEntity = manager.peer(manager.resolveEntityInfo(backType), returnValue); final EntityProxy<?, ?> proxy = manager.getProxyForEntity(returnValueEntity); if (selectFields.contains(Preload.ALL)) {
selectFields.addAll(entityInfo.getFieldNames()); final RawEntity returnValueEntity = manager.peer(entityInfo, primaryKeyType.getLogicalType().pullFromDatabase(manager, res, throughType, returnField)); final EntityProxy<?, ?> proxy = manager.getProxyForEntity(returnValueEntity); proxy.lockValuesDirty.lock();
selectFields.addAll(entityInfo.getFieldNames()); final RawEntity returnValueEntity = manager.peer(entityInfo, primaryKeyType.getLogicalType().pullFromDatabase(manager, res, throughType, returnField)); final EntityProxy<?, ?> proxy = manager.getProxyForEntity(returnValueEntity); proxy.lockValuesDirty.lock();
try { if (res.next()) { final RawEntity returnValueEntity = manager.peer(entityInfo, Common.getPrimaryKeyType(getTypeManager(), (Class<? extends RawEntity<K>>) remoteType).getLogicalType().pullFromDatabase(manager, res, (Class<K>) remoteType, remotePrimaryKeyFieldName)); if (selectFields.remove(Preload.ALL)) { selectFields.addAll(entityInfo.getFieldNames());
try { connection = provider.getConnection(); back = peer(entityInfo, provider.insertReturningKey(this, connection, type, entityInfo.getPrimaryKey().getJavaType(),
try { connection = provider.getConnection(); back = peer(entityInfo, provider.insertReturningKey(this, connection, type, entityInfo.getPrimaryKey().getJavaType(),
final String[] canonicalFields = query.getCanonicalFields(entityInfo); while (res.next()) { final T entity = peer(entityInfo, primaryKeyType.getLogicalType().pullFromDatabase(this, res, primaryKeyClassType, field)); final Map<String, Object> values = new HashMap<String, Object>(); for (String name : canonicalFields) {
final String[] canonicalFields = query.getCanonicalFields(entityInfo); while (res.next()) { final T entity = peer(entityInfo, primaryKeyType.getLogicalType().pullFromDatabase(this, res, primaryKeyClassType, field)); final Map<String, Object> values = new HashMap<String, Object>(); for (String name : canonicalFields) {