Java Code Examples for javax.persistence.AttributeOverrides

The following examples show how to use javax.persistence.AttributeOverrides. These examples are extracted from open source projects. 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
/**
 * @param mergeWithAnnotations Whether to use Java annotations for this
 * element, if present and not disabled by the XMLContext defaults.
 * In some contexts (such as an association mapping) merging with
 * annotations is never allowed.
 */
private AttributeOverrides mergeAttributeOverrides(XMLContext.Default defaults, List<AttributeOverride> attributes, boolean mergeWithAnnotations) {
	if ( mergeWithAnnotations && defaults.canUseJavaAnnotations() ) {
		AttributeOverride annotation = getPhysicalAnnotation( AttributeOverride.class );
		addAttributeOverrideIfNeeded( annotation, attributes );
		AttributeOverrides annotations = getPhysicalAnnotation( AttributeOverrides.class );
		if ( annotations != null ) {
			for ( AttributeOverride current : annotations.value() ) {
				addAttributeOverrideIfNeeded( current, attributes );
			}
		}
	}
	if ( attributes.size() > 0 ) {
		AnnotationDescriptor ad = new AnnotationDescriptor( AttributeOverrides.class );
		ad.setValue( "value", attributes.toArray( new AttributeOverride[attributes.size()] ) );
		return AnnotationFactory.create( ad );
	}
	else {
		return null;
	}
}
 
Example 2
Source Project: lams   Source File: MapBinder.java    License: GNU General Public License v2.0 6 votes vote down vote up
private boolean mappingDefinedAttributeOverrideOnMapKey(XProperty property) {
	if ( property.isAnnotationPresent( AttributeOverride.class ) ) {
		return namedMapKey( property.getAnnotation( AttributeOverride.class ) );
	}

	if ( property.isAnnotationPresent( AttributeOverrides.class ) ) {
		final AttributeOverrides annotations = property.getAnnotation( AttributeOverrides.class );
		for ( AttributeOverride attributeOverride : annotations.value() ) {
			if ( namedMapKey( attributeOverride ) ) {
				return true;
			}
		}
	}

	return false;
}
 
Example 3
Source Project: cosmic   Source File: DbUtil.java    License: Apache License 2.0 6 votes vote down vote up
public static final AttributeOverride[] getAttributeOverrides(final AnnotatedElement ae) {
    AttributeOverride[] overrides = null;

    final AttributeOverrides aos = ae.getAnnotation(AttributeOverrides.class);
    if (aos != null) {
        overrides = aos.value();
    }

    if (overrides == null || overrides.length == 0) {
        final AttributeOverride override = ae.getAnnotation(AttributeOverride.class);
        if (override != null) {
            overrides = new AttributeOverride[1];
            overrides[0] = override;
        } else {
            overrides = new AttributeOverride[0];
        }
    }

    return overrides;
}
 
Example 4
Source Project: cloudstack   Source File: DbUtil.java    License: Apache License 2.0 6 votes vote down vote up
public static final AttributeOverride[] getAttributeOverrides(AnnotatedElement ae) {
    AttributeOverride[] overrides = null;

    AttributeOverrides aos = ae.getAnnotation(AttributeOverrides.class);
    if (aos != null) {
        overrides = aos.value();
    }

    if (overrides == null || overrides.length == 0) {
        AttributeOverride override = ae.getAnnotation(AttributeOverride.class);
        if (override != null) {
            overrides = new AttributeOverride[1];
            overrides[0] = override;
        } else {
            overrides = new AttributeOverride[0];
        }
    }

    return overrides;
}
 
Example 5
@EmbeddedId
@AttributeOverrides({
		@AttributeOverride(name = "studentId", column = @Column(name = "STUDENT_ID", nullable = false, precision = 5, scale = 0)),
		@AttributeOverride(name = "classesId", column = @Column(name = "CLASSES_ID", nullable = false, precision = 4, scale = 0)),
		@AttributeOverride(name = "status", column = @Column(name = "STU_CLASSES_STATUS", nullable = false, length = 1)) })

public StudentClassesId getId() {
	return this.id;
}
 
Example 6
Source Project: cia   Source File: IndicatorElement.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the source.
*
* @return the source
*/
  @Embedded
  @AttributeOverrides({
      @AttributeOverride(name = "value", column = @Column(name = "SOURCE_VALUE")),
      @AttributeOverride(name = "id", column = @Column(name = "SOURCE_ID"))
  })
  public Source getSource() {
      return source;
  }
 
Example 7
Source Project: cia   Source File: VoteData.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the embedded id.
*
* @return the embedded id
*/
  @EmbeddedId
  @AttributeOverrides({
      @AttributeOverride(name = "issue", column = @Column(name = "EMBEDDED_ID_ISSUE")),
      @AttributeOverride(name = "ballotId", column = @Column(name = "EMBEDDED_ID_BALLOT_ID")),
      @AttributeOverride(name = "intressentId", column = @Column(name = "EMBEDDED_ID_INTRESSENT_ID")),
      @AttributeOverride(name = "concern", column = @Column(name = "EMBEDDED_ID_CONCERN"))
  })
  public VoteDataEmbeddedId getEmbeddedId() {
      return embeddedId;
  }
 
Example 8
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link ViewRiksdagenPartyBallotSupportAnnualSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "date", column = @Column(name = "EMBEDDED_ID_DATE")),
    @AttributeOverride(name = "party", column = @Column(name = "EMBEDDED_ID_PARTY")),
    @AttributeOverride(name = "otherParty", column = @Column(name = "EMBEDDED_ID_OTHER_PARTY"))
})
public ViewRiksdagenPartyBallotSupportAnnualSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 9
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "year", column = @Column(name = "EMBEDDED_ID_YEAR", precision = 10, scale = 0)),
    @AttributeOverride(name = "groupAgainst", column = @Column(name = "EMBEDDED_ID_GROUP_AGAINST"))
})
public ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 10
Source Project: cia   Source File: ViewRiksdagenCommittee.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenCommitteeEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "detail", column = @Column(name = "EMBEDDED_ID_DETAIL")),
    @AttributeOverride(name = "orgCode", column = @Column(name = "EMBEDDED_ID_ORG_CODE"))
})
public RiksdagenCommitteeEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 11
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenVoteDataBallotPoliticianPeriodSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "voteDate", column = @Column(name = "EMBEDDED_ID_VOTE_DATE")),
    @AttributeOverride(name = "intressentId", column = @Column(name = "EMBEDDED_ID_INTRESSENT_ID"))
})
public RiksdagenVoteDataBallotPoliticianPeriodSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 12
Source Project: cia   Source File: ViewRiksdagenVoteDataBallotSummary.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenVoteDataBallotEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "ballotId", column = @Column(name = "EMBEDDED_ID_BALLOT_ID")),
    @AttributeOverride(name = "concern", column = @Column(name = "EMBEDDED_ID_CONCERN")),
    @AttributeOverride(name = "issue", column = @Column(name = "EMBEDDED_ID_ISSUE"))
})
public RiksdagenVoteDataBallotEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 13
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link ViewRiksdagenCommitteeBallotDecisionPartyEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "id", column = @Column(name = "EMBEDDED_ID_ID")),
    @AttributeOverride(name = "party", column = @Column(name = "EMBEDDED_ID_PARTY")),
    @AttributeOverride(name = "hangarId", column = @Column(name = "EMBEDDED_ID_HANGAR_ID", precision = 20, scale = 10)),
    @AttributeOverride(name = "issue", column = @Column(name = "EMBEDDED_ID_ISSUE")),
    @AttributeOverride(name = "concern", column = @Column(name = "EMBEDDED_ID_CONCERN"))
})
public ViewRiksdagenCommitteeBallotDecisionPartyEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 14
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenVoteDataBallotPartyPeriodSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "voteDate", column = @Column(name = "EMBEDDED_ID_VOTE_DATE")),
    @AttributeOverride(name = "party", column = @Column(name = "EMBEDDED_ID_PARTY"))
})
public RiksdagenVoteDataBallotPartyPeriodSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 15
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenVoteDataBallotPoliticianPeriodSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "voteDate", column = @Column(name = "EMBEDDED_ID_VOTE_DATE")),
    @AttributeOverride(name = "intressentId", column = @Column(name = "EMBEDDED_ID_INTRESSENT_ID"))
})
public RiksdagenVoteDataBallotPoliticianPeriodSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 16
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenVoteDataBallotPartyPeriodSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "voteDate", column = @Column(name = "EMBEDDED_ID_VOTE_DATE")),
    @AttributeOverride(name = "party", column = @Column(name = "EMBEDDED_ID_PARTY"))
})
public RiksdagenVoteDataBallotPartyPeriodSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 17
Source Project: cia   Source File: ViewRiksdagenCommitteeDecisions.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link ViewRiksdagenCommitteeDecisionsEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "id", column = @Column(name = "EMBEDDED_ID_ID")),
    @AttributeOverride(name = "hangarId", column = @Column(name = "EMBEDDED_ID_HANGAR_ID", precision = 20, scale = 10)),
    @AttributeOverride(name = "issueNummer", column = @Column(name = "EMBEDDED_ID_ISSUE_NUMMER", precision = 20, scale = 10))
})
public ViewRiksdagenCommitteeDecisionsEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 18
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenVoteDataBallotPartyPeriodSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "voteDate", column = @Column(name = "EMBEDDED_ID_VOTE_DATE")),
    @AttributeOverride(name = "party", column = @Column(name = "EMBEDDED_ID_PARTY"))
})
public RiksdagenVoteDataBallotPartyPeriodSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 19
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link ViewRiksdagenCommitteeBallotDecisionPoliticianEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "id", column = @Column(name = "EMBEDDED_ID_ID")),
    @AttributeOverride(name = "intressentId", column = @Column(name = "EMBEDDED_ID_INTRESSENT_ID")),
    @AttributeOverride(name = "hangarId", column = @Column(name = "EMBEDDED_ID_HANGAR_ID", precision = 20, scale = 10)),
    @AttributeOverride(name = "issue", column = @Column(name = "EMBEDDED_ID_ISSUE")),
    @AttributeOverride(name = "concern", column = @Column(name = "EMBEDDED_ID_CONCERN"))
})
public ViewRiksdagenCommitteeBallotDecisionPoliticianEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 20
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenVoteDataBallotPoliticianPeriodSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "voteDate", column = @Column(name = "EMBEDDED_ID_VOTE_DATE")),
    @AttributeOverride(name = "intressentId", column = @Column(name = "EMBEDDED_ID_INTRESSENT_ID"))
})
public RiksdagenVoteDataBallotPoliticianPeriodSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 21
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenCommitteeDecisionTypeSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "decisionDate", column = @Column(name = "EMBEDDED_ID_DECISION_DATE")),
    @AttributeOverride(name = "decisionType", column = @Column(name = "EMBEDDED_ID_DECISION_TYPE"))
})
public RiksdagenCommitteeDecisionTypeSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 22
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenVoteDataBallotPartyEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "ballotId", column = @Column(name = "EMBEDDED_ID_BALLOT_ID")),
    @AttributeOverride(name = "concern", column = @Column(name = "EMBEDDED_ID_CONCERN")),
    @AttributeOverride(name = "issue", column = @Column(name = "EMBEDDED_ID_ISSUE")),
    @AttributeOverride(name = "party", column = @Column(name = "EMBEDDED_ID_PARTY"))
})
public RiksdagenVoteDataBallotPartyEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 23
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenVoteDataBallotPoliticianEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "ballotId", column = @Column(name = "EMBEDDED_ID_BALLOT_ID")),
    @AttributeOverride(name = "concern", column = @Column(name = "EMBEDDED_ID_CONCERN")),
    @AttributeOverride(name = "issue", column = @Column(name = "EMBEDDED_ID_ISSUE")),
    @AttributeOverride(name = "intressentId", column = @Column(name = "EMBEDDED_ID_INTRESSENT_ID"))
})
public RiksdagenVoteDataBallotPoliticianEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 24
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenVoteDataBallotPartyPeriodSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "voteDate", column = @Column(name = "EMBEDDED_ID_VOTE_DATE")),
    @AttributeOverride(name = "party", column = @Column(name = "EMBEDDED_ID_PARTY"))
})
public RiksdagenVoteDataBallotPartyPeriodSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 25
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link ViewRiksdagenCommitteeBallotDecisionEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "id", column = @Column(name = "EMBEDDED_ID_ID")),
    @AttributeOverride(name = "hangarId", column = @Column(name = "EMBEDDED_ID_HANGAR_ID", precision = 20, scale = 10)),
    @AttributeOverride(name = "issue", column = @Column(name = "EMBEDDED_ID_ISSUE")),
    @AttributeOverride(name = "concern", column = @Column(name = "EMBEDDED_ID_CONCERN"))
})
public ViewRiksdagenCommitteeBallotDecisionEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 26
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenVoteDataBallotPoliticianPeriodSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "voteDate", column = @Column(name = "EMBEDDED_ID_VOTE_DATE")),
    @AttributeOverride(name = "intressentId", column = @Column(name = "EMBEDDED_ID_INTRESSENT_ID"))
})
public RiksdagenVoteDataBallotPoliticianPeriodSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 27
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link RiksdagenCommitteeDecisionTypeOrgSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "decisionDate", column = @Column(name = "EMBEDDED_ID_DECISION_DATE")),
    @AttributeOverride(name = "decisionType", column = @Column(name = "EMBEDDED_ID_DECISION_TYPE")),
    @AttributeOverride(name = "org", column = @Column(name = "EMBEDDED_ID_ORG"))
})
public RiksdagenCommitteeDecisionTypeOrgSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 28
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link ApplicationActionEventPageElementPeriodSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "createdDate", column = @Column(name = "EMBEDDED_ID_CREATED_DATE")),
    @AttributeOverride(name = "page", column = @Column(name = "EMBEDDED_ID_PAGE")),
    @AttributeOverride(name = "elementId", column = @Column(name = "EMBEDDED_ID_ELEMENT_ID"))
})
public ApplicationActionEventPageElementPeriodSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 29
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link ApplicationActionEventPagePeriodSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "createdDate", column = @Column(name = "EMBEDDED_ID_CREATED_DATE")),
    @AttributeOverride(name = "page", column = @Column(name = "EMBEDDED_ID_PAGE"))
})
public ApplicationActionEventPagePeriodSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}
 
Example 30
/**
 * Gets the value of the embeddedId property.
 * 
 * @return
 *     possible object is
 *     {@link ApplicationActionEventPageModePeriodSummaryEmbeddedId }
 *     
 */
@EmbeddedId
@AttributeOverrides({
    @AttributeOverride(name = "createdDate", column = @Column(name = "EMBEDDED_ID_CREATED_DATE")),
    @AttributeOverride(name = "page", column = @Column(name = "EMBEDDED_ID_PAGE")),
    @AttributeOverride(name = "pageMode", column = @Column(name = "EMBEDDED_ID_PAGE_MODE"))
})
public ApplicationActionEventPageModePeriodSummaryEmbeddedId getEmbeddedId() {
    return embeddedId;
}