Source Taste: Hibernate/JPA: AbstractEntityManagerImpl

PART 1: static clause(static block)

static {
		entityManagerSpecificProperties.add( AvailableSettings.LOCK_SCOPE );
		entityManagerSpecificProperties.add( AvailableSettings.LOCK_TIMEOUT );
		entityManagerSpecificProperties.add( AvailableSettings.FLUSH_MODE );
		entityManagerSpecificProperties.add( AvailableSettings.SHARED_CACHE_RETRIEVE_MODE );
		entityManagerSpecificProperties.add( AvailableSettings.SHARED_CACHE_STORE_MODE );
		entityManagerSpecificProperties.add( QueryHints.SPEC_HINT_TIMEOUT );
	}
Quoted from <Thinking in Java>: This code, like other static initializations, is executed only once: the first time you make an object of that class or the first time you access a static member of that class(even if you never make an object of that class).

PART 2:  A Bunch of 'private static class' in class AbstractEntityManagerImpl

NOTE: In java, static class is for inner class ONLY!

你可能感兴趣的:(Source Taste: Hibernate/JPA: AbstractEntityManagerImpl)