public Class getType() { return _val.getType(); }
String typeOf(ValueMetaData vm) { if (vm.getTypeMetaData() == null) return typeOf(vm.getType()); return typeOf(vm.getTypeMetaData()); }
public Class getType() { return _val.getType(); }
public Class getType() { return _val.getType(); }
public Class getType() { return _val.getType(); }
public Class getType() { return _val.getType(); }
/** * Convert the field value to a collection. Handles collections and * arrays by default. */ protected Collection toCollection(Object val) { if (field.getTypeCode() == JavaTypes.COLLECTION) return (Collection) val; return JavaTypes.toList(val, field.getElement().getType(), false); }
/** * Convert the field value to a collection. Handles collections and * arrays by default. */ protected Collection toCollection(Object val) { if (field.getTypeCode() == JavaTypes.COLLECTION) return (Collection) val; return JavaTypes.toList(val, field.getElement().getType(), false); }
/** * Convert the field value to a collection. Handles collections and * arrays by default. */ protected Collection toCollection(Object val) { if (field.getTypeCode() == JavaTypes.COLLECTION) return (Collection) val; return JavaTypes.toList(val, field.getElement().getType(), false); }
/** * Convert the field value to a collection. Handles collections and * arrays by default. */ protected Collection toCollection(Object val) { if (field.getTypeCode() == JavaTypes.COLLECTION) return (Collection) val; return JavaTypes.toList(val, field.getElement().getType(), false); }
/** * Convert the field value to a collection. Handles collections and * arrays by default. */ protected Collection toCollection(Object val) { if (field.getTypeCode() == JavaTypes.COLLECTION) return (Collection) val; return JavaTypes.toList(val, field.getElement().getType(), false); }
private static Set<Class<?>> collectRelatedUnspecifiedTypes(ClassMetaData meta, Collection<? extends Class<?>> classes, Set<Class<?>> unspecified) { unspecified = collectUnspecifiedType(meta.getPCSuperclass(), classes, unspecified); for (FieldMetaData fmd : meta.getFields()) { if (fmd.isTransient()) continue; if (fmd.isTypePC()) unspecified = collectUnspecifiedType(fmd.getType(), classes, unspecified); if (fmd.getElement() != null && fmd.getElement().isTypePC()) unspecified = collectUnspecifiedType(fmd.getElement().getType(), classes, unspecified); if (fmd.getKey() != null && fmd.getKey().isTypePC()) unspecified = collectUnspecifiedType(fmd.getKey().getType(), classes, unspecified); if (fmd.getValue() != null && fmd.getValue().isTypePC()) unspecified = collectUnspecifiedType(fmd.getValue().getType(), classes, unspecified); } return unspecified; }
private static Set<Class<?>> collectRelatedUnspecifiedTypes(ClassMetaData meta, Collection<? extends Class<?>> classes, Set<Class<?>> unspecified) { unspecified = collectUnspecifiedType(meta.getPCSuperclass(), classes, unspecified); for (FieldMetaData fmd : meta.getFields()) { if (fmd.isTransient()) continue; if (fmd.isTypePC()) unspecified = collectUnspecifiedType(fmd.getType(), classes, unspecified); if (fmd.getElement() != null && fmd.getElement().isTypePC()) unspecified = collectUnspecifiedType(fmd.getElement().getType(), classes, unspecified); if (fmd.getKey() != null && fmd.getKey().isTypePC()) unspecified = collectUnspecifiedType(fmd.getKey().getType(), classes, unspecified); if (fmd.getValue() != null && fmd.getValue().isTypePC()) unspecified = collectUnspecifiedType(fmd.getValue().getType(), classes, unspecified); } return unspecified; }
private static Set<Class> collectRelatedUnspecifiedTypes(ClassMetaData meta, Collection<? extends Class> classes, Set<Class> unspecified) { unspecified = collectUnspecifiedType(meta.getPCSuperclass(), classes, unspecified); for (FieldMetaData fmd : meta.getFields()) { if (fmd.isTransient()) continue; if (fmd.isTypePC()) unspecified = collectUnspecifiedType(fmd.getType(), classes, unspecified); if (fmd.getElement() != null && fmd.getElement().isTypePC()) unspecified = collectUnspecifiedType(fmd.getElement().getType(), classes, unspecified); if (fmd.getKey() != null && fmd.getKey().isTypePC()) unspecified = collectUnspecifiedType(fmd.getKey().getType(), classes, unspecified); if (fmd.getValue() != null && fmd.getValue().isTypePC()) unspecified = collectUnspecifiedType(fmd.getValue().getType(), classes, unspecified); } return unspecified; }
public Object loadEagerParallel(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Object res) throws SQLException { // process batched results if we haven't already Map rels; if (res instanceof Result) rels = processEagerParallelResult(sm, store, fetch, (Result) res); else rels = (Map) res; // look up the collection for this oid, and store in instance Object coll = rels.remove(sm.getObjectId()); if (field.getTypeCode() == JavaTypes.ARRAY) sm.storeObject(field.getIndex(), JavaTypes.toArray ((Collection) coll, field.getElement().getType())); else { if (coll == null) coll = sm.newProxy(field.getIndex()); sm.storeObject(field.getIndex(), coll); } return rels; }
public String getValueMappedBy() { if (_mappedBy == MAPPED_BY_PK) { // use this instead of getting meta from element b/c that // requires element to be resolved ClassMetaData meta = getRepository().getMetaData (_owner.getElement().getType(), null, false); if (meta == null) throw new MetaDataException(_loc.get("val-not-pc", _owner)); if (meta.getPrimaryKeyFields().length != 1) throw new MetaDataException(_loc.get("val-not-one-pk", _owner)); _mappedByMeta = meta.getPrimaryKeyFields()[0]; _mappedBy = _mappedByMeta.getName(); } return _mappedBy; }
public String getValueMappedBy() { if (_mappedBy == MAPPED_BY_PK) { // use this instead of getting meta from element b/c that // requires element to be resolved ClassMetaData meta = getRepository().getMetaData (_owner.getElement().getType(), null, false); if (meta == null) throw new MetaDataException(_loc.get("val-not-pc", _owner)); if (meta.getPrimaryKeyFields().length != 1) throw new MetaDataException(_loc.get("val-not-one-pk", _owner)); _mappedByMeta = meta.getPrimaryKeyFields()[0]; _mappedBy = _mappedByMeta.getName(); } return _mappedBy; }
public String getValueMappedBy() { if (_mappedBy == MAPPED_BY_PK) { // use this instead of getting meta from element b/c that // requires element to be resolved ClassMetaData meta = getRepository().getMetaData (_owner.getElement().getType(), null, false); if (meta == null) throw new MetaDataException(_loc.get("val-not-pc", _owner)); if (meta.getPrimaryKeyFields().length != 1) throw new MetaDataException(_loc.get("val-not-one-pk", _owner)); _mappedByMeta = meta.getPrimaryKeyFields()[0]; _mappedBy = _mappedByMeta.getName(); } return _mappedBy; }
public String getValueMappedBy() { if (_mappedBy == MAPPED_BY_PK) { // use this instead of getting meta from element b/c that // requires element to be resolved ClassMetaData meta = getRepository().getMetaData (_owner.getElement().getType(), null, false); if (meta == null) throw new MetaDataException(_loc.get("val-not-pc", _owner)); if (meta.getPrimaryKeyFields().length != 1) throw new MetaDataException(_loc.get("val-not-one-pk", _owner)); _mappedByMeta = meta.getPrimaryKeyFields()[0]; _mappedBy = _mappedByMeta.getName(); } return _mappedBy; }
public String getValueMappedBy() { if (_mappedBy == MAPPED_BY_PK) { // use this instead of getting meta from element b/c that // requires element to be resolved ClassMetaData meta = getRepository().getMetaData (_owner.getElement().getType(), null, false); if (meta == null) throw new MetaDataException(_loc.get("val-not-pc", _owner)); if (meta.getPrimaryKeyFields().length != 1) throw new MetaDataException(_loc.get("val-not-one-pk", _owner)); _mappedByMeta = meta.getPrimaryKeyFields()[0]; _mappedBy = _mappedByMeta.getName(); } return _mappedBy; }