Java Code Examples for javax.persistence.AccessType#PROPERTY

The following examples show how to use javax.persistence.AccessType#PROPERTY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PersistentAttributesHelper.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
public static <T extends Annotation> T getAnnotation(CtClass ctClass, String attributeName, Class<T> annotation) {
	AccessType classAccessType = getAccessTypeOrNull( ctClass );
	CtField field = findFieldOrNull( ctClass, attributeName );
	CtMethod getter = findGetterOrNull( ctClass, attributeName );

	if ( classAccessType == AccessType.FIELD || ( field != null && getAccessTypeOrNull( field ) == AccessType.FIELD ) ) {
		return field == null ? null : getAnnotationOrNull( field, annotation );
	}
	if ( classAccessType == AccessType.PROPERTY || ( getter != null && getAccessTypeOrNull( getter ) == AccessType.PROPERTY ) ) {
		return getter == null ? null : getAnnotationOrNull( getter, annotation );
	}

	T found = ( getter == null ? null : getAnnotationOrNull( getter, annotation ) );
	if ( found == null && field != null ) {
		return getAnnotationOrNull( field, annotation );
	}
	return found;
}
 
Example 2
Source File: PropertyAccessMixedImpl.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
protected static AccessType getAccessType(Class<?> containerJavaType, String propertyName) {
	Field field = fieldOrNull( containerJavaType, propertyName );
	AccessType fieldAccessType = getAccessTypeOrNull( field );
	if ( fieldAccessType != null ) {
		return fieldAccessType;
	}
	AccessType methodAccessType = getAccessTypeOrNull( getterMethodOrNull( containerJavaType, propertyName ) );
	if ( methodAccessType != null ) {
		return methodAccessType;
	}
	// No @Access on property or field; check to see if containerJavaType has an explicit @Access
	AccessType classAccessType = getAccessTypeOrNull( containerJavaType );
	if ( classAccessType != null ) {
		return classAccessType;
	}
	return field != null ? AccessType.FIELD : AccessType.PROPERTY;
}
 
Example 3
Source File: Zone.java    From cosmic with Apache License 2.0 5 votes vote down vote up
@Access(AccessType.PROPERTY)
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
public long getId() {
    return super.getId();
}
 
Example 4
Source File: Address.java    From vaadinator with Apache License 2.0 5 votes vote down vote up
@Column(length = 1024)
@Access(AccessType.PROPERTY)
public String getMagFilmeAsString() {
	StringBuffer res = new StringBuffer();
	Set<Filme> set = getMagFilme();
	if (set != null) {
		for (Filme f : set) {
			if (res.length() > 0) {
				res.append(",");
			}
			res.append(f.name());
		}
	}
	return res.toString();
}
 
Example 5
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "lb_provider")
public String getLoadBalancerProvider() {
    return super.getLoadBalancerProvider();
}
 
Example 6
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "ip6_dns2")
public String getIp6Dns2() {
    return super.getIp6Dns2();
}
 
Example 7
Source File: AbstractJpaBaseEntity.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
@Override
@Access(AccessType.PROPERTY)
@Column(name = "last_modified_at", insertable = true, updatable = true, nullable = false)
public long getLastModifiedAt() {
    return lastModifiedAt;
}
 
Example 8
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "internal_dns2")
public String getInternalDns2() {
    return super.getInternalDns2();
}
 
Example 9
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "uuid")
public String getUuid() {
    return super.getUuid();
}
 
Example 10
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "guest_network_cidr")
public String getGuestNetworkCidr() {
    return super.getGuestNetworkCidr();
}
 
Example 11
Source File: AbstractJpaBaseEntity.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
@Override
@Access(AccessType.PROPERTY)
@Column(name = "created_at", insertable = true, updatable = false, nullable = false)
public long getCreatedAt() {
    return createdAt;
}
 
Example 12
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "router_mac_address", updatable = false, nullable = false)
public String getRouterMacAddress() {
    return super.getRouterMacAddress();
}
 
Example 13
Source File: ContractApplication.java    From vaadinator with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
public int getMonthlyFee() {
	// (we want to have it in the DB also so we can query - see below)
	return 0 + (isRetirementProtection() ? 1111 : 0) + (isLazinessProtection() ? 8888 : 0);
}
 
Example 14
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "domain_id")
public Long getDomainId() {
    return super.getDomainId();
}
 
Example 15
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "dns_provider")
public String getDnsProvider() {
    return super.getDnsProvider();
}
 
Example 16
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "dns2")
public String getDns2() {
    return super.getDns2();
}
 
Example 17
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "dhcp_provider")
public String getDhcpProvider() {
    return super.getDhcpProvider();
}
 
Example 18
Source File: AbstractJpaBaseEntity.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
@Override
@Access(AccessType.PROPERTY)
@Column(name = "created_by", insertable = true, updatable = false, nullable = false, length = 64)
public String getCreatedBy() {
    return createdBy;
}
 
Example 19
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "allocation_state")
@Enumerated(value = EnumType.STRING)
public AllocationState getAllocationState() {
    return super.getAllocationState();
}
 
Example 20
Source File: Zone.java    From cosmic with Apache License 2.0 4 votes vote down vote up
@Access(AccessType.PROPERTY)
@Column(name = "networktype")
@Enumerated(EnumType.STRING)
public NetworkType getNetworkType() {
    return super.getNetworkType();
}