@Override protected ClassDescriptor buildDirectCollectionMappingDescriptor() { XMLDescriptor descriptor = (XMLDescriptor)super.buildDirectCollectionMappingDescriptor(); XMLDirectMapping joinFetchMapping = new XMLDirectMapping(); joinFetchMapping.setAttributeName("joinFetch"); joinFetchMapping.setXPath(getPrimaryNamespaceXPath() + "join-fetch/text()"); ObjectTypeConverter joinFetchConverter = new ObjectTypeConverter(); joinFetchConverter.addConversionValue("inner-join", Integer.valueOf(ForeignReferenceMapping.INNER_JOIN)); joinFetchConverter.addConversionValue("outer-join", Integer.valueOf(ForeignReferenceMapping.OUTER_JOIN)); joinFetchConverter.addConversionValue("none", Integer.valueOf(ForeignReferenceMapping.NONE)); joinFetchMapping.setConverter(joinFetchConverter); joinFetchMapping.setNullValue(ForeignReferenceMapping.NONE); descriptor.addMapping(joinFetchMapping); return descriptor; }
@Override protected ClassDescriptor buildDirectCollectionMappingDescriptor() { XMLDescriptor descriptor = (XMLDescriptor)super.buildDirectCollectionMappingDescriptor(); XMLDirectMapping joinFetchMapping = new XMLDirectMapping(); joinFetchMapping.setAttributeName("joinFetch"); joinFetchMapping.setXPath(getPrimaryNamespaceXPath() + "join-fetch/text()"); ObjectTypeConverter joinFetchConverter = new ObjectTypeConverter(); joinFetchConverter.addConversionValue("inner-join", new Integer(ForeignReferenceMapping.INNER_JOIN)); joinFetchConverter.addConversionValue("outer-join", new Integer(ForeignReferenceMapping.OUTER_JOIN)); joinFetchConverter.addConversionValue("none", new Integer(ForeignReferenceMapping.NONE)); joinFetchMapping.setConverter(joinFetchConverter); joinFetchMapping.setNullValue(ForeignReferenceMapping.NONE); descriptor.addMapping(joinFetchMapping); return descriptor; }
@Override protected ClassDescriptor buildOneToManyMappingMappingDescriptor() { XMLDescriptor descriptor = (XMLDescriptor)super.buildOneToManyMappingMappingDescriptor(); XMLDirectMapping joinFetchMapping = new XMLDirectMapping(); joinFetchMapping.setAttributeName("joinFetch"); joinFetchMapping.setXPath(getPrimaryNamespaceXPath() + "join-fetch/text()"); ObjectTypeConverter joinFetchConverter = new ObjectTypeConverter(); joinFetchConverter.addConversionValue("inner-join", Integer.valueOf(ForeignReferenceMapping.INNER_JOIN)); joinFetchConverter.addConversionValue("outer-join", Integer.valueOf(ForeignReferenceMapping.OUTER_JOIN)); joinFetchConverter.addConversionValue("none", Integer.valueOf(ForeignReferenceMapping.NONE)); joinFetchMapping.setConverter(joinFetchConverter); joinFetchMapping.setNullValue(ForeignReferenceMapping.NONE); descriptor.addMapping(joinFetchMapping); return descriptor; }
@Override protected ClassDescriptor buildManyToManyMappingMappingDescriptor() { XMLDescriptor descriptor = (XMLDescriptor)super.buildManyToManyMappingMappingDescriptor(); XMLDirectMapping joinFetchMapping = new XMLDirectMapping(); joinFetchMapping.setAttributeName("joinFetch"); joinFetchMapping.setXPath(getPrimaryNamespaceXPath() + "join-fetch/text()"); ObjectTypeConverter joinFetchConverter = new ObjectTypeConverter(); joinFetchConverter.addConversionValue("inner-join", Integer.valueOf(ForeignReferenceMapping.INNER_JOIN)); joinFetchConverter.addConversionValue("outer-join", Integer.valueOf(ForeignReferenceMapping.OUTER_JOIN)); joinFetchConverter.addConversionValue("none", Integer.valueOf(ForeignReferenceMapping.NONE)); joinFetchMapping.setConverter(joinFetchConverter); joinFetchMapping.setNullValue(ForeignReferenceMapping.NONE); descriptor.addMapping(joinFetchMapping); return descriptor; }
@Override protected ClassDescriptor buildOneToOneMappingDescriptor() { XMLDescriptor descriptor = (XMLDescriptor)super.buildOneToOneMappingDescriptor(); descriptor.removeMappingForAttributeName("joinFetch"); XMLDirectMapping joinFetchMapping = new XMLDirectMapping(); joinFetchMapping.setAttributeName("joinFetch"); joinFetchMapping.setXPath(getPrimaryNamespaceXPath() + "join-fetch/text()"); ObjectTypeConverter joinFetchConverter = new ObjectTypeConverter(); joinFetchConverter.addConversionValue("inner-join", new Integer(ForeignReferenceMapping.INNER_JOIN)); joinFetchConverter.addConversionValue("outer-join", new Integer(ForeignReferenceMapping.OUTER_JOIN)); joinFetchConverter.addConversionValue("none", new Integer(ForeignReferenceMapping.NONE)); joinFetchMapping.setConverter(joinFetchConverter); joinFetchMapping.setNullValue(ForeignReferenceMapping.NONE); descriptor.addMapping(joinFetchMapping); return descriptor; }
protected ClassDescriptor buildPessimisticLockingPolicyDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(PessimisticLockingPolicy.class); descriptor.setDefaultRootElement("pessimistic-locking-policy"); XMLDirectMapping lockingModeMapping = new XMLDirectMapping(); lockingModeMapping.setXPath(getPrimaryNamespaceXPath() + "locking-mode/text()"); lockingModeMapping.setAttributeName("lockingMode"); lockingModeMapping.setGetMethodName("getLockingMode"); lockingModeMapping.setSetMethodName("setLockingMode"); ObjectTypeConverter lockingModeConverter = new ObjectTypeConverter(); lockingModeConverter.addConversionValue("wait", Short.valueOf(ObjectLevelReadQuery.LOCK)); lockingModeConverter.addConversionValue("no-wait", Short.valueOf(ObjectLevelReadQuery.LOCK_NOWAIT)); lockingModeMapping.setConverter(lockingModeConverter); descriptor.addMapping(lockingModeMapping); return descriptor; }
protected ClassDescriptor buildPessimisticLockingPolicyDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(PessimisticLockingPolicy.class); descriptor.setDefaultRootElement("pessimistic-locking-policy"); XMLDirectMapping lockingModeMapping = new XMLDirectMapping(); lockingModeMapping.setXPath(getPrimaryNamespaceXPath() + "locking-mode/text()"); lockingModeMapping.setAttributeName("lockingMode"); lockingModeMapping.setGetMethodName("getLockingMode"); lockingModeMapping.setSetMethodName("setLockingMode"); ObjectTypeConverter lockingModeConverter = new ObjectTypeConverter(); lockingModeConverter.addConversionValue("wait", Short.valueOf(ObjectLevelReadQuery.LOCK)); lockingModeConverter.addConversionValue("no-wait", Short.valueOf(ObjectLevelReadQuery.LOCK_NOWAIT)); lockingModeMapping.setConverter(lockingModeConverter); descriptor.addMapping(lockingModeMapping); return descriptor; }
protected ClassDescriptor buildXMLAnyObjectMappingDescriptor() { ClassDescriptor descriptor = super.buildXMLAnyObjectMappingDescriptor(); XMLDirectMapping keepAsElementMapping = new XMLDirectMapping(); keepAsElementMapping.setAttributeName("keepAsElementPolicy"); keepAsElementMapping.setGetMethodName("getKeepAsElementPolicy"); keepAsElementMapping.setSetMethodName("setKeepAsElementPolicy"); keepAsElementMapping.setXPath(getPrimaryNamespaceXPath() + "keep-as-element-policy"); EnumTypeConverter converter = new EnumTypeConverter(keepAsElementMapping, UnmarshalKeepAsElementPolicy.class, false); keepAsElementMapping.setConverter(converter); descriptor.addMapping(keepAsElementMapping); return descriptor; }
protected ClassDescriptor buildXMLAnyObjectMappingDescriptor() { ClassDescriptor descriptor = super.buildXMLAnyObjectMappingDescriptor(); XMLDirectMapping keepAsElementMapping = new XMLDirectMapping(); keepAsElementMapping.setAttributeName("keepAsElementPolicy"); keepAsElementMapping.setGetMethodName("getKeepAsElementPolicy"); keepAsElementMapping.setSetMethodName("setKeepAsElementPolicy"); keepAsElementMapping.setXPath(getPrimaryNamespaceXPath() + "keep-as-element-policy"); EnumTypeConverter converter = new EnumTypeConverter(keepAsElementMapping, UnmarshalKeepAsElementPolicy.class, false); keepAsElementMapping.setConverter(converter); descriptor.addMapping(keepAsElementMapping); return descriptor; }
protected ClassDescriptor buildJDBCTypeWrapperDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(JDBCTypeWrapper.class); descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class); XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping(); wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType"); wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME); EnumTypeConverter jdbcTypesEnumTypeConverter = new EnumTypeConverter( wrappedDatabaseTypeMapping, JDBCTypes.class, false); wrappedDatabaseTypeMapping.setConverter(jdbcTypesEnumTypeConverter); descriptor.addMapping(wrappedDatabaseTypeMapping); return descriptor; }
protected ClassDescriptor buildSimplePLSQLTypeWrapperDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(SimplePLSQLTypeWrapper.class); descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class); XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping(); wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType"); wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME); EnumTypeConverter oraclePLSQLTypesEnumTypeConverter = new EnumTypeConverter( wrappedDatabaseTypeMapping, OraclePLSQLTypes.class, false); wrappedDatabaseTypeMapping.setConverter(oraclePLSQLTypesEnumTypeConverter); descriptor.addMapping(wrappedDatabaseTypeMapping); return descriptor; }
protected ClassDescriptor buildXMLAnyObjectMappingDescriptor() { ClassDescriptor descriptor = super.buildXMLAnyObjectMappingDescriptor(); XMLDirectMapping keepAsElementMapping = new XMLDirectMapping(); keepAsElementMapping.setAttributeName("keepAsElementPolicy"); keepAsElementMapping.setGetMethodName("getKeepAsElementPolicy"); keepAsElementMapping.setSetMethodName("setKeepAsElementPolicy"); keepAsElementMapping.setXPath(getPrimaryNamespaceXPath() + "keep-as-element-policy"); EnumTypeConverter converter = new EnumTypeConverter(keepAsElementMapping, UnmarshalKeepAsElementPolicy.class, false); keepAsElementMapping.setConverter(converter); descriptor.addMapping(keepAsElementMapping); return descriptor; }
protected ClassDescriptor buildSimplePLSQLTypeWrapperDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(SimplePLSQLTypeWrapper.class); descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class); XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping(); wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType"); wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME); EnumTypeConverter oraclePLSQLTypesEnumTypeConverter = new EnumTypeConverter( wrappedDatabaseTypeMapping, OraclePLSQLTypes.class, false); wrappedDatabaseTypeMapping.setConverter(oraclePLSQLTypesEnumTypeConverter); descriptor.addMapping(wrappedDatabaseTypeMapping); return descriptor; }
protected ClassDescriptor buildJDBCTypeWrapperDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(JDBCTypeWrapper.class); descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class); XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping(); wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType"); wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME); EnumTypeConverter jdbcTypesEnumTypeConverter = new EnumTypeConverter( wrappedDatabaseTypeMapping, JDBCTypes.class, false); wrappedDatabaseTypeMapping.setConverter(jdbcTypesEnumTypeConverter); descriptor.addMapping(wrappedDatabaseTypeMapping); return descriptor; }
protected ClassDescriptor buildSimplePLSQLTypeWrapperDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(SimplePLSQLTypeWrapper.class); descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class); XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping(); wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType"); wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME); EnumTypeConverter oraclePLSQLTypesEnumTypeConverter = new EnumTypeConverter( wrappedDatabaseTypeMapping, OraclePLSQLTypes.class, false); wrappedDatabaseTypeMapping.setConverter(oraclePLSQLTypesEnumTypeConverter); descriptor.addMapping(wrappedDatabaseTypeMapping); return descriptor; }
protected ClassDescriptor buildJDBCTypeWrapperDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(JDBCTypeWrapper.class); descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class); XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping(); wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType"); wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME); EnumTypeConverter jdbcTypesEnumTypeConverter = new EnumTypeConverter( wrappedDatabaseTypeMapping, JDBCTypes.class, false); wrappedDatabaseTypeMapping.setConverter(jdbcTypesEnumTypeConverter); descriptor.addMapping(wrappedDatabaseTypeMapping); return descriptor; }
/** * INTERNAL: */ protected XMLDirectMapping getExcludeSuperclassListenersMapping() { XMLDirectMapping excludeSuperclassListenersMapping = new XMLDirectMapping(); excludeSuperclassListenersMapping.setAttributeName("m_excludeSuperclassListeners"); excludeSuperclassListenersMapping.setGetMethodName("getExcludeSuperclassListeners"); excludeSuperclassListenersMapping.setSetMethodName("setExcludeSuperclassListeners"); excludeSuperclassListenersMapping.setConverter(new EmptyElementConverter()); IsSetNullPolicy excludeSuperclassListenersPolicy = new IsSetNullPolicy("excludeSuperclassListeners"); excludeSuperclassListenersPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE); excludeSuperclassListenersMapping.setNullPolicy(excludeSuperclassListenersPolicy); excludeSuperclassListenersMapping.setXPath("orm:exclude-superclass-listeners"); return excludeSuperclassListenersMapping; }
/** * INTERNAL: */ protected XMLDirectMapping getReturnUpdateMapping() { XMLDirectMapping mapping = new XMLDirectMapping(); mapping.setAttributeName("m_returnUpdate"); mapping.setGetMethodName("getReturnUpdate"); mapping.setSetMethodName("setReturnUpdate"); mapping.setConverter(new EmptyElementConverter()); IsSetNullPolicy returnUpdatePolicy = new IsSetNullPolicy("isReturnUpdate"); returnUpdatePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE); mapping.setNullPolicy(returnUpdatePolicy); mapping.setXPath("orm:return-update"); return mapping; }
/** * INTERNAL: */ protected XMLDirectMapping getDeleteAllMapping() { XMLDirectMapping deleteAllMapping = new XMLDirectMapping(); deleteAllMapping.setAttributeName("m_deleteAll"); deleteAllMapping.setGetMethodName("getDeleteAll"); deleteAllMapping.setSetMethodName("setDeleteAll"); deleteAllMapping.setXPath("orm:delete-all"); deleteAllMapping.setConverter(new EmptyElementConverter()); IsSetNullPolicy deleteAllPolicy = new IsSetNullPolicy("isDeleteAll"); deleteAllPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE); deleteAllMapping.setNullPolicy(deleteAllPolicy); return deleteAllMapping; }
/** * INTERNAL: */ protected XMLDirectMapping getNonCacheableMapping() { XMLDirectMapping noncacheable = new XMLDirectMapping(); noncacheable.setAttributeName("m_nonCacheable"); noncacheable.setGetMethodName("getNonCacheable"); noncacheable.setSetMethodName("setNonCacheable"); noncacheable.setConverter(new EmptyElementConverter()); IsSetNullPolicy cacheablePolicy = new IsSetNullPolicy("isNonCacheable"); cacheablePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE); noncacheable.setNullPolicy(cacheablePolicy); noncacheable.setXPath("orm:noncacheable"); return noncacheable; }