Java 类javax.persistence.Access 实例源码

项目:lams    文件:JPAOverriddenAnnotationReader.java   
private void getAccessType(List<Annotation> annotationList, Element element) {
    if ( element == null ) {
        return;
    }
    String access = element.attributeValue( "access" );
    if ( access != null ) {
        AnnotationDescriptor ad = new AnnotationDescriptor( Access.class );
        AccessType type;
        try {
            type = AccessType.valueOf( access );
        }
        catch ( IllegalArgumentException e ) {
            throw new AnnotationException( access + " is not a valid access type. Check you xml confguration." );
        }

        if ( ( AccessType.PROPERTY.equals( type ) && this.element instanceof Method ) ||
                ( AccessType.FIELD.equals( type ) && this.element instanceof Field ) ) {
            return;
        }

        ad.setValue( "value", type );
        annotationList.add( AnnotationFactory.create( ad ) );
    }
}
项目:oma-riista-web    文件:EmailToken.java   
@Override
@Id
@Size(min = 16, max = 255)
@Access(value = AccessType.PROPERTY)
@Column(name = "token_data", nullable = false, length = 255)
public String getId() {
    return id;
}
项目:oma-riista-web    文件:SrvaEvent.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "srva_event_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:ObservationContextSensitiveFields.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:lams    文件:PropertyContainer.java   
private AccessType determineClassDefinedAccessStrategy() {
    AccessType classDefinedAccessType;

    AccessType hibernateDefinedAccessType = AccessType.DEFAULT;
    AccessType jpaDefinedAccessType = AccessType.DEFAULT;

    org.hibernate.annotations.AccessType accessType = xClass.getAnnotation( org.hibernate.annotations.AccessType.class );
    if ( accessType != null ) {
        hibernateDefinedAccessType = AccessType.getAccessStrategy( accessType.value() );
    }

    Access access = xClass.getAnnotation( Access.class );
    if ( access != null ) {
        jpaDefinedAccessType = AccessType.getAccessStrategy( access.value() );
    }

    if ( hibernateDefinedAccessType != AccessType.DEFAULT
            && jpaDefinedAccessType != AccessType.DEFAULT
            && hibernateDefinedAccessType != jpaDefinedAccessType ) {
        throw new MappingException(
                "@AccessType and @Access specified with contradicting values. Use of @Access only is recommended. "
        );
    }

    if ( hibernateDefinedAccessType != AccessType.DEFAULT ) {
        classDefinedAccessType = hibernateDefinedAccessType;
    }
    else {
        classDefinedAccessType = jpaDefinedAccessType;
    }
    return classDefinedAccessType;
}
项目:lams    文件:EntityBinder.java   
public AccessType getExplicitAccessType(XAnnotatedElement element) {
    AccessType accessType = null;

    AccessType hibernateAccessType = null;
    AccessType jpaAccessType = null;

    org.hibernate.annotations.AccessType accessTypeAnnotation = element.getAnnotation( org.hibernate.annotations.AccessType.class );
    if ( accessTypeAnnotation != null ) {
        hibernateAccessType = AccessType.getAccessStrategy( accessTypeAnnotation.value() );
    }

    Access access = element.getAnnotation( Access.class );
    if ( access != null ) {
        jpaAccessType = AccessType.getAccessStrategy( access.value() );
    }

    if ( hibernateAccessType != null && jpaAccessType != null && hibernateAccessType != jpaAccessType ) {
        throw new MappingException(
                "Found @Access and @AccessType with conflicting values on a property in class " + annotatedClass.toString()
        );
    }

    if ( hibernateAccessType != null ) {
        accessType = hibernateAccessType;
    }
    else if ( jpaAccessType != null ) {
        accessType = jpaAccessType;
    }

    return accessType;
}
项目:lams    文件:PropertyInferredData.java   
public AccessType getDefaultAccess() throws MappingException {
    AccessType accessType = defaultAccess;

    AccessType hibernateAccessType = AccessType.DEFAULT;
    AccessType jpaAccessType = AccessType.DEFAULT;

    org.hibernate.annotations.AccessType accessTypeAnnotation = property.getAnnotation( org.hibernate.annotations.AccessType.class );
    if ( accessTypeAnnotation != null ) {
        hibernateAccessType = AccessType.getAccessStrategy( accessTypeAnnotation.value() );
    }

    Access access = property.getAnnotation( Access.class );
    if ( access != null ) {
        jpaAccessType = AccessType.getAccessStrategy( access.value() );
    }

    if ( hibernateAccessType != AccessType.DEFAULT
            && jpaAccessType != AccessType.DEFAULT
            && hibernateAccessType != jpaAccessType ) {

        StringBuilder builder = new StringBuilder();
        builder.append( property.toString() );
        builder.append(
                " defines @AccessType and @Access with contradicting values. Use of @Access only is recommended."
        );
        throw new MappingException( builder.toString() );
    }

    if ( hibernateAccessType != AccessType.DEFAULT ) {
        accessType = hibernateAccessType;
    }
    else if ( jpaAccessType != AccessType.DEFAULT ) {
        accessType = jpaAccessType;
    }
    return accessType;
}
项目:oma-riista-web    文件:Integration.java   
@Override
@Id
@Access(value = AccessType.PROPERTY)
@Column(name = "integration_id", nullable = false)
@Size(max = 255)
public String getId() {
    return this.id;
}
项目:oma-riista-web    文件:AnnouncementSubscriber.java   
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "announcement_subscriber_id", nullable = false)
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:Announcement.java   
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "announcement_id", nullable = false)
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:HuntingClubArea.java   
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = ID_COLUMN_NAME, nullable = false)
public Long getId() {
    return this.id;
}
项目:oma-riista-web    文件:MooseDataCardImport.java   
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "moose_data_card_import_id", nullable = false)
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:GroupHuntingDay.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "group_hunting_day_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:ObservationRejection.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "group_observation_rejection_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:HarvestRejection.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "group_harvest_rejection_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:HuntingClubMemberInvitation.java   
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "hunting_club_member_invitation_id", nullable = false)
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:BasicClubHuntingSummary.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "hunting_summary_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:MooseHuntingSummary.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "moose_hunting_summary_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:MooseHarvestReport.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "moose_harvest_report_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:GISHirvitalousalue.java   
@Override
@Id
@Access(value = AccessType.PROPERTY)
@Column(name = "gid", nullable = false)
public Integer getId() {
    return id;
}
项目:oma-riista-web    文件:GISMetsahallitusHirvi.java   
@Override
@Id
@Access(value = AccessType.PROPERTY)
@Column(name = "gid", nullable = false)
public Integer getId() {
    return id;
}
项目:oma-riista-web    文件:GISZone.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = ID_COLUMN_NAME, nullable = false)
@Override
public Long getId() {
    return this.id;
}
项目:oma-riista-web    文件:SrvaMethod.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = ID_COLUMN_NAME, nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:SrvaSpecimen.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = ID_COLUMN_NAME, nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:Harvest.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "harvest_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:HarvestSpecimen.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "harvest_specimen_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:Observation.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "game_observation_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:ObservationSpecimen.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "observation_specimen_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:GameDiaryImage.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "game_diary_image_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:AccountActivityMessage.java   
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "message_id", nullable = false)
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:SystemUser.java   
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "user_id", nullable = false)
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:VetumaTransaction.java   
@Override
@Id
@VetumaTransactionId
@Access(value = AccessType.PROPERTY)
@Column(name = "vetuma_transaction_id", nullable = false)
public String getId() {
    return id;
}
项目:oma-riista-web    文件:HarvestPermitSpeciesAmount.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "harvest_permit_species_amount_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:HarvestArea.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = ID_COLUMN_NAME, nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:HarvestQuota.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "harvest_quota_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:HarvestPermit.java   
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = ID_COLUMN_NAME, nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:HarvestPermitAreaHta.java   
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "harvest_permit_area_hta_id", nullable = false)
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:HarvestPermitArea.java   
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "harvest_permit_area_id", nullable = false)
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:HarvestPermitAreaRhy.java   
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "harvest_permit_area_rhy_id", nullable = false)
public Long getId() {
    return id;
}
项目:oma-riista-web    文件:HarvestPermitAreaEvent.java   
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "harvest_permit_area_event_id", nullable = false)
public Long getId() {
    return id;
}