~raginggoblin/infolog/infolog

« back to all changes in this revision

Viewing changes to InfologServer/lib/hibernate-annotations-3.4.0.GA/src/org/hibernate/cfg/annotations/SetBinder.java

  • Committer: Raging Goblin
  • Date: 2013-11-16 16:51:32 UTC
  • Revision ID: raging_goblin-20131116165132-weujnptzc88uy4ah
Mavenized the project, now using shared project InfologSync

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package org.hibernate.cfg.annotations;
2
 
 
3
 
import org.hibernate.annotations.OrderBy;
4
 
import org.hibernate.cfg.Environment;
5
 
import org.hibernate.mapping.Collection;
6
 
import org.hibernate.mapping.PersistentClass;
7
 
import org.slf4j.Logger;
8
 
import org.slf4j.LoggerFactory;
9
 
 
10
 
/**
11
 
 * Bind a set.
12
 
 *
13
 
 * @author Matthew Inger
14
 
 */
15
 
public class SetBinder extends CollectionBinder {
16
 
        private final Logger log = LoggerFactory.getLogger( SetBinder.class );
17
 
 
18
 
        public SetBinder() {
19
 
        }
20
 
 
21
 
        public SetBinder(boolean sorted) {
22
 
                super( sorted );
23
 
        }
24
 
 
25
 
        protected Collection createCollection(PersistentClass persistentClass) {
26
 
                return new org.hibernate.mapping.Set( persistentClass );
27
 
        }
28
 
 
29
 
        public void setSqlOrderBy(OrderBy orderByAnn) {
30
 
                if ( orderByAnn != null ) {
31
 
                        if ( Environment.jvmSupportsLinkedHashCollections() ) {
32
 
                                super.setSqlOrderBy( orderByAnn );
33
 
                        }
34
 
                        else {
35
 
                                log.warn( "Attribute \"order-by\" ignored in JDK1.3 or less" );
36
 
                        }
37
 
                }
38
 
        }
39
 
}