/** * Determine the name of the property for the entity encapsulated by the * given type which represents the id or unique-key. * * @param entityType The type representing the entity. * * @return The corresponding property name * * @throws QueryException Indicates such a property could not be found. */ public String getIdentifierOrUniqueKeyPropertyName(EntityType entityType) { try { return entityType.getIdentifierOrUniqueKeyPropertyName( sfi ); } catch ( MappingException me ) { throw new QueryException( me ); } }
idPropertyName = propertyType.getIdentifierOrUniqueKeyPropertyName( q.getFactory() );
protected void initIdentifierPropertyPaths( final String path, final EntityType etype, final String[] columns, final String[] columnReaders, final String[] columnReaderTemplates, final Mapping factory) throws MappingException { Type idtype = etype.getIdentifierOrUniqueKeyType( factory ); String idPropName = etype.getIdentifierOrUniqueKeyPropertyName( factory ); boolean hasNonIdentifierPropertyNamedId = hasNonIdentifierPropertyNamedId( etype, factory ); if ( etype.isReferenceToPrimaryKey() ) { if ( !hasNonIdentifierPropertyNamedId ) { String idpath1 = extendPath( path, EntityPersister.ENTITY_ID ); addPropertyPath( idpath1, idtype, columns, columnReaders, columnReaderTemplates, null, factory ); initPropertyPaths( idpath1, idtype, columns, columnReaders, columnReaderTemplates, null, factory ); } } if ( (! etype.isNullable() ) && idPropName != null ) { String idpath2 = extendPath( path, idPropName ); addPropertyPath( idpath2, idtype, columns, columnReaders, columnReaderTemplates, null, factory ); initPropertyPaths( idpath2, idtype, columns, columnReaders, columnReaderTemplates, null, factory ); } }
String getIdentifierOrUniqueKeyPropertyName(EntityType entityType) { try { return entityType.getIdentifierOrUniqueKeyPropertyName( sfi ); } catch ( MappingException me ) { throw new QueryException( me ); } }
/** * Determine the name of the property for the entity encapsulated by the * given type which represents the id or unique-key. * * @param entityType The type representing the entity. * @return The corresponding property name * @throws QueryException Indicates such a property could not be found. */ public String getIdentifierOrUniqueKeyPropertyName(EntityType entityType) { try { return entityType.getIdentifierOrUniqueKeyPropertyName( sfi ); } catch ( MappingException me ) { throw new QueryException( me ); } }
/** * Determine the name of the property for the entity encapsulated by the * given type which represents the id or unique-key. * * @param entityType The type representing the entity. * @return The corresponding property name * @throws QueryException Indicates such a property could not be found. */ public String getIdentifierOrUniqueKeyPropertyName(EntityType entityType) { try { return entityType.getIdentifierOrUniqueKeyPropertyName( sfi ); } catch ( MappingException me ) { throw new QueryException( me ); } }
/** * Determine the name of the property for the entity encapsulated by the * given type which represents the id or unique-key. * * @param entityType The type representing the entity. * @return The corresponding property name * @throws QueryException Indicates such a property could not be found. */ public String getIdentifierOrUniqueKeyPropertyName(EntityType entityType) { try { return entityType.getIdentifierOrUniqueKeyPropertyName( sfi ); } catch ( MappingException me ) { throw new QueryException( me ); } }
private void collectPropertyNames(Collection<String> propertyNames, String prefix, Type propertyType, Mapping factory) { if (propertyType instanceof ComponentType) { ComponentType componentType = (ComponentType) propertyType; for (String propertyName : componentType.getPropertyNames()) { Type subtype = componentType.getSubtypes()[componentType.getPropertyIndex(propertyName)]; collectPropertyNames(propertyNames, prefix == null ? propertyName : prefix + "." + propertyName, subtype, factory); } } else if (propertyType instanceof org.hibernate.type.EntityType) { org.hibernate.type.EntityType entityType = (org.hibernate.type.EntityType) propertyType; Type identifierOrUniqueKeyType = entityType.getIdentifierOrUniqueKeyType(factory); if (identifierOrUniqueKeyType instanceof EmbeddedComponentType) { EmbeddedComponentType embeddedComponentType = (EmbeddedComponentType) identifierOrUniqueKeyType; for (String propertyName : embeddedComponentType.getPropertyNames()) { propertyNames.add(prefix == null ? propertyName : prefix + "." + propertyName); } } else { String identifierOrUniqueKeyPropertyName = entityType.getIdentifierOrUniqueKeyPropertyName(factory); propertyNames.add(prefix == null ? identifierOrUniqueKeyPropertyName : prefix + "." + identifierOrUniqueKeyPropertyName); } } else if (!(propertyType instanceof CollectionType) && prefix != null) { propertyNames.add(prefix); } }
idPropertyName = propertyType.getIdentifierOrUniqueKeyPropertyName( q.getFactory() );
idPropertyName = propertyType.getIdentifierOrUniqueKeyPropertyName( q.getFactory() );
idPropertyName = propertyType.getIdentifierOrUniqueKeyPropertyName( q.getFactory() );
idPropertyName = propertyType.getIdentifierOrUniqueKeyPropertyName( q.getFactory() );
protected void initIdentifierPropertyPaths( final String path, final EntityType etype, final String[] columns, final Mapping factory) throws MappingException { Type idtype = etype.getIdentifierOrUniqueKeyType(factory); if ( etype.isReferenceToPrimaryKey() ) { String idpath1 = extendPath(path, EntityPersister.ENTITY_ID); addPropertyPath(idpath1, idtype, columns, null); initPropertyPaths(idpath1, idtype, columns, null, factory); } String idPropName = etype.getIdentifierOrUniqueKeyPropertyName(factory); if (idPropName!=null) { String idpath2 = extendPath(path, idPropName); addPropertyPath(idpath2, idtype, columns, null); initPropertyPaths(idpath2, idtype, columns, null, factory); } }
protected void initIdentifierPropertyPaths( final String path, final EntityType etype, final String[] columns, final Mapping factory) throws MappingException { Type idtype = etype.getIdentifierOrUniqueKeyType(factory); if ( etype.isReferenceToPrimaryKey() ) { String idpath1 = extendPath(path, EntityPersister.ENTITY_ID); addPropertyPath(idpath1, idtype, columns, null); initPropertyPaths(idpath1, idtype, columns, null, factory); } String idPropName = etype.getIdentifierOrUniqueKeyPropertyName(factory); if (idPropName!=null) { String idpath2 = extendPath(path, idPropName); addPropertyPath(idpath2, idtype, columns, null); initPropertyPaths(idpath2, idtype, columns, null, factory); } }
AbstractEntityPersister elementPersister = (AbstractEntityPersister) entityPersisters.get(((org.hibernate.type.EntityType) persister.getElementType()).getAssociatedEntityName()); Type identifierType = ((org.hibernate.type.EntityType) persister.getElementType()).getIdentifierOrUniqueKeyType(persister.getFactory()); String identifierOrUniqueKeyPropertyName = ((org.hibernate.type.EntityType) persister.getElementType()).getIdentifierOrUniqueKeyPropertyName(persister.getFactory()); String prefix; if (identifierType instanceof EmbeddedComponentType) {
String identifierOrUniqueKeyPropertyName = ((org.hibernate.type.EntityType) persister.getElementType()).getIdentifierOrUniqueKeyPropertyName(persister.getFactory()); String prefix; if (identifierType instanceof EmbeddedComponentType) {
protected void initIdentifierPropertyPaths( final String path, final EntityType etype, final String[] columns, final String[] columnReaders, final String[] columnReaderTemplates, final Mapping factory) throws MappingException { Type idtype = etype.getIdentifierOrUniqueKeyType( factory ); String idPropName = etype.getIdentifierOrUniqueKeyPropertyName(factory); boolean hasNonIdentifierPropertyNamedId = hasNonIdentifierPropertyNamedId( etype, factory ); if ( etype.isReferenceToPrimaryKey() ) { if ( !hasNonIdentifierPropertyNamedId ) { String idpath1 = extendPath(path, EntityPersister.ENTITY_ID); addPropertyPath(idpath1, idtype, columns, columnReaders, columnReaderTemplates, null); initPropertyPaths(idpath1, idtype, columns, columnReaders, columnReaderTemplates, null, factory); } } if (idPropName!=null) { String idpath2 = extendPath(path, idPropName); addPropertyPath(idpath2, idtype, columns, columnReaders, columnReaderTemplates, null); initPropertyPaths(idpath2, idtype, columns, columnReaders, columnReaderTemplates, null, factory); } }
protected void initIdentifierPropertyPaths( final String path, final EntityType etype, final String[] columns, final String[] columnReaders, final String[] columnReaderTemplates, final Mapping factory) throws MappingException { Type idtype = etype.getIdentifierOrUniqueKeyType( factory ); String idPropName = etype.getIdentifierOrUniqueKeyPropertyName(factory); boolean hasNonIdentifierPropertyNamedId = hasNonIdentifierPropertyNamedId( etype, factory ); if ( etype.isReferenceToPrimaryKey() ) { if ( !hasNonIdentifierPropertyNamedId ) { String idpath1 = extendPath(path, EntityPersister.ENTITY_ID); addPropertyPath(idpath1, idtype, columns, columnReaders, columnReaderTemplates, null); initPropertyPaths(idpath1, idtype, columns, columnReaders, columnReaderTemplates, null, factory); } } if (idPropName!=null) { String idpath2 = extendPath(path, idPropName); addPropertyPath(idpath2, idtype, columns, columnReaders, columnReaderTemplates, null); initPropertyPaths(idpath2, idtype, columns, columnReaders, columnReaderTemplates, null, factory); } }