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

This code example shows how to use the following methods: getPropertyAccessor, isBackRef
	 * return accessors  
	 * @param mappedProperty 
	 * @return 
	 */ 
	private PropertyAccessor buildPropertyAccessor(Property mappedProperty) {
		if ( mappedProperty.isBackRef() ) {
			PropertyAccessor ac = mappedProperty.getPropertyAccessor(null);
			if(ac!=null) return ac;
		} 
		return accessor;
	} 
 
	 
	@Override 
	protected Getter buildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity) {
		return buildPropertyAccessor(mappedProperty).getGetter( null, mappedProperty.getName() );
	} 
 
	 
	@Override 
Full Snippet Info
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: setName
        Logger logger = mockLogger(); 
 
        replay(); 
 
        RootClass persistentClass = new RootClass();
        Property idProperty = new Property();
        idProperty.setName("id");
        persistentClass.setIdentifierProperty(idProperty);
        SampleEntity entity = new SampleEntity();
 
        HibernateEntityValueEncoder<SampleEntity> encoder = new HibernateEntityValueEncoder<SampleEntity>(
                SampleEntity.class, persistentClass, session, access, typeCoercer, logger);
 
        assertNull(encoder.toClient(entity));
 
        verify(); 
    } 
 
    @Test
    public void to_value_not_found() 
Full Snippet Info
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: getCascadeStyle, getName, getValue, getValueGenerationStrategy, isInsertable
		// we need to dirty check collections, since they can cause an owner 
		// version number increment 
		 
		// we need to dirty check many-to-ones with not-found="ignore" in order  
		// to update the cache (not the database), since in this case a null 
		// entity reference can lose information 
		 
		boolean alwaysDirtyCheck = type.isAssociationType() && 
				( (AssociationType) type ).isAlwaysDirtyChecked(); 
 
		return new StandardProperty(
				property.getName(),
				property.getNodeName(),
				type,
				lazyAvailable && property.isLazy(),
				property.isInsertable(),
				property.isUpdateable(),
		        property.getGeneration() == PropertyGeneration.INSERT || property.getGeneration() == PropertyGeneration.ALWAYS,
				property.getGeneration() == PropertyGeneration.ALWAYS,
				property.isOptional(),

5
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: getName, getValue
         checkKeyProperties( id, extraId );
          
     } 
	protected void checkKeyProperties(Property id, Property extraId) {
		assertEquals(toPropertyName("customerid"), id.getName() );
         assertEquals(toPropertyName("ordernumber"), extraId.getName() );
          
         assertFalse(id.getValue() instanceof ManyToOne);
         assertFalse(extraId.getValue() instanceof ManyToOne);
	} 
      
     public void testKeyProperty() { 
        cfg.buildMappings(); 
         
        PersistentClass product = cfg.getClassMapping( toClassName(identifier("Product") ) );
         
        Property identifierProperty = product.getIdentifierProperty();
         
        assertTrue(identifierProperty.getValue() instanceof Component);
         
Full Snippet Info
5
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: getName, getPropertyAccessor, isBackRef
	 * {@inheritDoc} 
	 */ 
	public EntityMode getEntityMode() { 
		return EntityMode.MAP; 
	} 
 
	private PropertyAccessor buildPropertyAccessor(Property mappedProperty) { 
		if ( mappedProperty.isBackRef() ) { 
			return mappedProperty.getPropertyAccessor(null); 
		} 
		else { 
			return PropertyAccessorFactory.getDynamicMapPropertyAccessor(); 
		} 
	} 
 
	/** 
	 * {@inheritDoc} 
	 */ 
	@Override 
    protected Getter buildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity) { 
		return buildPropertyAccessor(mappedProperty).getGetter( null, mappedProperty.getName() ); 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE