Best code examples for Hibernate ORM Collection class (org.hibernate.mapping.Collection)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM Collection class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Hibernate ORM Collection examples from Open Source projects
This code example shows how to use the following methods: getComparatorClassName, isSorted, accept
		if(c2j.getJavaTypeName(p, false)==null) {
			throw new IllegalArgumentException();
		} else if (p.getValue() instanceof Collection) {
			Collection col = (Collection) p.getValue();
			 
			DefaultInitializor initialization = (DefaultInitializor) col.accept(new DefaultValueVisitor(true) {
			  
				public Object accept(Bag o) {
					return new DefaultInitializor("java.util.ArrayList", true); 
				} 
				 
				public Object accept(org.hibernate.mapping.List o) {
					return new DefaultInitializor("java.util.ArrayList", true); 
				} 
				 
				public Object accept(org.hibernate.mapping.Map o) {
					if(o.isSorted()) {
						return new DefaultInitializor("java.util.TreeMap", false); 
					} else { 
						return new DefaultInitializor("java.util.HashMap", true); 

5
CodeRank
This code example shows how to use the following methods: getElement
	public Object accept(OneToMany value) {
		return value.getAssociatedClass().getEntityName();
	} 
	 
	public Object acceptCollection(Collection c) {
		return c.getElement().accept( this );
	} 
	 
	public Object accept(Bag o) {
		return acceptCollection( o );
	} 
	 
	public Object accept(List o) {
		return acceptCollection( o );
	} 
	 
	public Object accept(IdentifierBag o) {
		return acceptCollection( o );
	} 
	 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getRole, isMap

5
CodeRank
This code example shows how to use the following methods: getCollectionPersisterClass, getRole
 
	@Test
	public void testCollectionPersisterSpecified() throws Exception {
		//tests the persister specified by the @Persister annotation on a collection 
		Collection collection = (Collection) configuration().getCollectionMapping( Deck.class.getName() + ".cards" );
		assertEquals( "Incorrect Persister class for collection " + collection.getRole(), CollectionPersister.class,
				collection.getCollectionPersisterClass() );
	} 
 
	@Override 
	protected Class[] getAnnotatedClasses() {
		return new Class[]{
				Card.class, 
				Deck.class 
		}; 
	} 
} 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isSorted
		return super.accept(o);
	} 
	 
	// special handling for Set's to avoid initialization of comparators that depends on the keys/values which might not be generated yet. 
	public Object accept(Set o) {
		if ( o.isSorted() ) {
			return "java.util.SortedSet"; 
		} 
		return super.accept(o);
	} 
 
	public Object accept(Component value) {
		// composite-element breaks without it. 
		return value.getComponentClassName();
	} 
		 
	public Object accept(OneToOne o) {
		return acceptToOne(o);
	} 
	 
Full Snippet Info
5
CodeRank