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 ) ); } }
@Override @Id @Size(min = 16, max = 255) @Access(value = AccessType.PROPERTY) @Column(name = "token_data", nullable = false, length = 255) public String getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "srva_event_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
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; }
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; }
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; }
@Override @Id @Access(value = AccessType.PROPERTY) @Column(name = "integration_id", nullable = false) @Size(max = 255) public String getId() { return this.id; }
@Override @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = "announcement_subscriber_id", nullable = false) public Long getId() { return id; }
@Override @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = "announcement_id", nullable = false) public Long getId() { return id; }
@Override @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = ID_COLUMN_NAME, nullable = false) public Long getId() { return this.id; }
@Override @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = "moose_data_card_import_id", nullable = false) public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "group_hunting_day_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "group_observation_rejection_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "group_harvest_rejection_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Override @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = "hunting_club_member_invitation_id", nullable = false) public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "hunting_summary_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "moose_hunting_summary_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "moose_harvest_report_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Override @Id @Access(value = AccessType.PROPERTY) @Column(name = "gid", nullable = false) public Integer getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = ID_COLUMN_NAME, nullable = false) @Override public Long getId() { return this.id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = ID_COLUMN_NAME, nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "harvest_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "harvest_specimen_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "game_observation_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "observation_specimen_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "game_diary_image_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Override @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = "message_id", nullable = false) public Long getId() { return id; }
@Override @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = "user_id", nullable = false) public Long getId() { return id; }
@Override @Id @VetumaTransactionId @Access(value = AccessType.PROPERTY) @Column(name = "vetuma_transaction_id", nullable = false) public String getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "harvest_permit_species_amount_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "harvest_quota_id", nullable = false) @Access(value = AccessType.PROPERTY) @Override public Long getId() { return id; }
@Override @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = "harvest_permit_area_hta_id", nullable = false) public Long getId() { return id; }
@Override @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = "harvest_permit_area_id", nullable = false) public Long getId() { return id; }
@Override @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = "harvest_permit_area_rhy_id", nullable = false) public Long getId() { return id; }
@Override @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @Column(name = "harvest_permit_area_event_id", nullable = false) public Long getId() { return id; }