Hibernate ORM EntityType - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM EntityType class.

This code example shows how to use the following methods: getAssociatedEntityName, getIdentifierOrUniqueKeyPropertyName, isOneToOne, isReferenceToPrimaryKey
			throws QueryException {
		//NOTE: we avoid joining to the next table if the named property is just the foreign key value 
 
		//if its "id" 
		boolean isIdShortcut = EntityPersister.ENTITY_ID.equals( propertyName ) &&
				propertyType.isReferenceToPrimaryKey();
 
		//or its the id property name 
		final String idPropertyName;
		try { 
			idPropertyName = propertyType.getIdentifierOrUniqueKeyPropertyName( q.getFactory() );
		} 
		catch ( MappingException me ) {
			throw new QueryException( me );
		} 
		boolean isNamedIdPropertyShortcut = idPropertyName != null
				&& idPropertyName.equals( propertyName )
				&& propertyType.isReferenceToPrimaryKey();
 
 

5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getAssociatedEntityName
		} 
 
		Serializable id;
		try { 
			id = ForeignKeys.getEntityIdentifierIfNotUnsaved(
					foreignValueSourceType.getAssociatedEntityName(),
					associatedObject, 
					sessionImplementor
			); 
		} 
		catch (TransientObjectException toe) {
			id = session.save( foreignValueSourceType.getAssociatedEntityName(), associatedObject );
		} 
 
		if ( session.contains(object) ) {
			//abort the save (the object is already saved by a circular cascade) 
			return IdentifierGeneratorHelper.SHORT_CIRCUIT_INDICATOR;
			//throw new IdentifierGenerationException("save associated object first, or disable cascade for inverse association"); 
		} 
		return id;
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getAssociatedEntityName
		// I don't believe that Mapping#getReferencedPropertyType accounts for the identifier property; so 
		// if it returns for a property named 'id', then we should have a non-id field named id 
		try { 
			return factory.getReferencedPropertyType( entityType.getAssociatedEntityName(), EntityPersister.ENTITY_ID ) != null; 
		} 
		catch( MappingException e ) { 
			return false; 
		} 
	} 
 
	protected void initComponentPropertyPaths( 
			final String path, 
			final CompositeType type, 
			final String[] columns, 
			final String[] columnReaders, 
			final String[] columnReaderTemplates, 
			String[] formulaTemplates, final Mapping factory) throws MappingException { 
 
		Type[] types = type.getSubtypes(); 
		String[] properties = type.getPropertyNames(); 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getIdentifierOrUniqueKeyPropertyName
	} 
 
	/** 
	 * Given a collection type, determine the entity name of the elements 
	 * contained within instance of that collection. 
	 * 
	 * @param collectionType The collection type to check. 
	 * @return The entity name of the elements of this collection. 
	 */ 
	public String getAssociatedEntityName(CollectionType collectionType) { 
		return collectionType.getAssociatedEntityName( sfi ); 
	} 
 
	/** 
	 * Given a collection type, determine the Type representing elements 
	 * within instances of that collection. 
	 * 
	 * @param collectionType The collection type to be checked. 
	 * @return The Type of the elements of the collection. 
	 */ 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Hibernate ORM EntityType Methods: