Package com.sun.codemodel

Examples of com.sun.codemodel.JCodeModel.ref()


            m.annotate( cm.ref( javax.persistence.PostPersist.class ) );
        }
        if ( ms.getPostRemove() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPostRemove().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PostRemove.class ) );
        }
        if ( ms.getPostUpdate() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPostUpdate().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PostUpdate.class ) );
View Full Code Here


            m.annotate( cm.ref( javax.persistence.PostRemove.class ) );
        }
        if ( ms.getPostUpdate() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPostUpdate().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PostUpdate.class ) );
        }
        if ( ms.getPrePersist() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPreUpdate().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PrePersist.class ) );
View Full Code Here

            m.annotate( cm.ref( javax.persistence.PostUpdate.class ) );
        }
        if ( ms.getPrePersist() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPreUpdate().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PrePersist.class ) );
        }
        if ( ms.getPreRemove() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPreRemove().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PreRemove.class ) );
View Full Code Here

            m.annotate( cm.ref( javax.persistence.PrePersist.class ) );
        }
        if ( ms.getPreRemove() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPreRemove().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PreRemove.class ) );
        }
        if ( ms.getPreUpdate() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPreUpdate().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PreUpdate.class ) );
View Full Code Here

            m.annotate( cm.ref( javax.persistence.PreRemove.class ) );
        }
        if ( ms.getPreUpdate() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPreUpdate().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PreUpdate.class ) );
        }
    }

    private void annotateEmbeddable( final Outline outline, final Embeddable embeddable )
    {
View Full Code Here

    private void annotateEmbeddable( final Outline outline, final Embeddable embeddable )
    {
        final JCodeModel cm = outline.getCodeModel();
        final ClassOutline c = this.getClassOutline( outline, embeddable.getClazz() );
        c.implClass.annotate( cm.ref( javax.persistence.Embeddable.class ) );

        if ( embeddable.getAttributes() != null )
        {
            this.annotate( c, embeddable.getAttributes() );
        }
View Full Code Here

    private void annotateEntity( final Outline outline, final Entity entity )
    {
        final JCodeModel cm = outline.getCodeModel();
        final ClassOutline c = this.getClassOutline( outline, entity.getClazz() );
        final JAnnotationUse a = c.implClass.annotate( cm.ref( javax.persistence.Entity.class ) );

        if ( entity.getName() != null )
        {
            a.param( "name", entity.getName() );
        }
View Full Code Here

            a.param( "name", entity.getName() );
        }

        if ( !entity.getAssociationOverride().isEmpty() )
        {
            final JAnnotationUse aolst = c.implClass.annotate( cm.ref( javax.persistence.AssociationOverrides.class ) );
            final JAnnotationArrayMember value = aolst.paramArray( "value" );
            for ( AssociationOverride o : entity.getAssociationOverride() )
            {
                final JAnnotationUse ao = value.annotate( cm.ref( javax.persistence.AssociationOverride.class ) );
                if ( o.getName() != null )
View Full Code Here

        {
            final JAnnotationUse aolst = c.implClass.annotate( cm.ref( javax.persistence.AssociationOverrides.class ) );
            final JAnnotationArrayMember value = aolst.paramArray( "value" );
            for ( AssociationOverride o : entity.getAssociationOverride() )
            {
                final JAnnotationUse ao = value.annotate( cm.ref( javax.persistence.AssociationOverride.class ) );
                if ( o.getName() != null )
                {
                    ao.param( "name", o.getName() );
                }
View Full Code Here

                if ( !o.getJoinColumn().isEmpty() )
                {
                    final JAnnotationArrayMember joinColumns = ao.paramArray( "joinColumns" );
                    for ( JoinColumn jc : o.getJoinColumn() )
                    {
                        final JAnnotationUse jca = joinColumns.annotate( cm.ref( javax.persistence.JoinColumn.class ) );
                        this.annotate( jca, jc );
                    }
                }
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.