Hibernate ORM CollectionPersister - 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 CollectionPersister class.

This code example shows how to use the following methods: getFactory, getKeyType, getOwnerEntityPersister, getRole
This code example shows how to use the following methods: getElementNodeName, getElementType, getFactory, getIndexNodeName, getIndexType
			element = owner.element( nodeName ); 
			if (element==null) element = owner.addElement( nodeName ); 
		} 
	} 
 
	public boolean isWrapper(Object collection) { 
		return element==collection; 
	} 
 
	public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException { 
		Type elementType = persister.getElementType(); 
		String indexNode = getIndexAttributeName(persister);		 
		HashMap snapshot = (HashMap) getSnapshot(); 
		List elements = element.elements( persister.getElementNodeName() ); 
		if ( snapshot.size()!= elements.size() ) return false; 
		for ( int i=0; i<snapshot.size(); i++ ) { 
			Element elem = (Element) elements.get(i); 
			Object old = snapshot.get( getIndex(elem, indexNode, i) ); 
			Object current = elementType.fromXMLNode( elem, persister.getFactory() ); 
			if ( elementType.isDirty( old, current, getSession() ) ) return false; 

6
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: getElementColumnAliases, getIdentifierColumnAlias, getIndexColumnAliases, getKeyColumnAliases
		this.suffix = suffix;
		this.userProvidedAliases = userProvidedAliases;
 
		this.keyAliases = getUserProvidedAliases(
				"key",  
				persister.getKeyColumnAliases( suffix )
			); 
 
		this.indexAliases = getUserProvidedAliases(
				"index", 
				persister.getIndexColumnAliases( suffix )
				); 
		 
		this.elementAliases = getUserProvidedAliases( "element", 
				persister.getElementColumnAliases( suffix )
				); 
				 
		this.identifierAlias = getUserProvidedAlias( "id", 
				persister.getIdentifierColumnAlias( suffix )
				); 

6
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: getCollectionType, getElementType, hasIndex, isOneToMany, getElementColumnNames
	private void prepareForIndex(QueryTranslatorImpl q) throws QueryException {
 
		QueryableCollection collPersister = q.getCollectionPersister( collectionRole );
 
		if ( !collPersister.hasIndex() ) throw new QueryException( "unindexed collection before []: " + path );
		String[] indexCols = collPersister.getIndexColumnNames();
		if ( indexCols.length != 1 ) throw new QueryException( "composite-index appears in []: " + path );
		//String[] keyCols = collPersister.getKeyColumnNames(); 
 
		JoinSequence fromJoins = new JoinSequence( q.getFactory() )
				.setUseThetaStyle( useThetaStyleJoin )
				.setRoot( collPersister, collectionName )
				.setNext( joinSequence.copy() );
 
		if ( !continuation ) addJoin( collectionName, collPersister.getCollectionType() );
 
		joinSequence.addCondition( collectionName + '.' + indexCols[0] + " = " ); //TODO: get SQL rendering out of here
 
		CollectionElement elem = new CollectionElement();
		elem.elementColumns = collPersister.getElementColumnNames(collectionName);

6
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: getElementNodeName, getElementType, getFactory, readElement
	public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner) 
	throws HibernateException { 
 
		Type elementType = persister.getElementType(); 
		Serializable[] cached = (Serializable[]) disassembled; 
		for ( int i=0; i<cached.length; i++ ) { 
			Object object = elementType.assemble( cached[i], getSession(), owner ); 
			Element subelement = element.addElement( persister.getElementNodeName() ); 
			elementType.setToXMLNode( subelement, object, persister.getFactory() ); 
		} 
 
	} 
 
	public Serializable disassemble(CollectionPersister persister) throws HibernateException { 
 
		Type elementType = persister.getElementType(); 
		List elements =  element.elements( persister.getElementNodeName() ); 
		int length = elements.size(); 
		Serializable[] result = new Serializable[length]; 
		for ( int i=0; i<length; i++ ) { 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Hibernate ORM CollectionPersister Methods: