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

This code example shows how to use the following methods: toString
	} 
 
	@Override 
	public void configure(Configuration cfg) {
		super.configure( cfg );
		cfg.setProperty( Environment.DEFAULT_ENTITY_MODE, EntityMode.MAP.toString() );
	} 
 
	@Test
	public void testMap() throws Exception {
		Session s = openSession();
		s.beginTransaction();
		Map map = new HashMap();
		map.put("$type$", "TestMap");
		map.put("name", "foo");
		map.put("address", "bar");
		Map cmp = new HashMap();
		cmp.put( "a", new Integer(1) );
		cmp.put( "b", new Float(1.0) );
		map.put("cmp", cmp);
Full Snippet Info
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: equals
     * @param mode The mode for the resulting entity. 
     * @return An appropriate accessor. 
     * @throws MappingException 
     */ 
	public static PropertyAccessor getPropertyAccessor(Property property, EntityMode mode) throws MappingException {
		//TODO: this is temporary in that the end result will probably not take a Property reference per-se. 
	    if ( null == mode || EntityMode.POJO.equals( mode ) ) {
		    return getPojoPropertyAccessor( property.getPropertyAccessorName() );
	    } 
	    else if ( EntityMode.MAP.equals( mode ) ) {
		    return getDynamicMapPropertyAccessor();
	    } 
	    else { 
		    throw new MappingException( "Unknown entity mode [" + mode + "]" );
	    } 
	} 
 
	/** 
     * Retrieves a PropertyAccessor instance based on the given property definition and 
     * entity mode. 
Full Snippet Info
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: equals
This code example shows how to use the following methods: toString
	 * @return The deserialized CollectionKey 
	 * @throws IOException 
	 * @throws ClassNotFoundException 
	 */ 
	public static CollectionKey deserialize(
			ObjectInputStream ois,
	        SessionImplementor session) throws IOException, ClassNotFoundException {
		return new CollectionKey(
				( String ) ois.readObject(),
		        ( Serializable ) ois.readObject(),
		        ( Type ) ois.readObject(),
		        EntityMode.parse( ( String ) ois.readObject() ),
		        ( session == null ? null : session.getFactory() )
		); 
	} 
} 
Full Snippet Info
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java