类javax.persistence.MapKeyColumn源码实例Demo

下面列出了怎么用javax.persistence.MapKeyColumn的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: lams   文件: JPAOverriddenAnnotationReader.java
private void getMapKeyColumn(List<Annotation> annotationList, Element element) {
	Element subelement = element != null ? element.element( "map-key-column" ) : null;
	if ( subelement != null ) {
		AnnotationDescriptor ad = new AnnotationDescriptor( MapKeyColumn.class );
		copyStringAttribute( ad, subelement, "name", false );
		copyBooleanAttribute( ad, subelement, "unique" );
		copyBooleanAttribute( ad, subelement, "nullable" );
		copyBooleanAttribute( ad, subelement, "insertable" );
		copyBooleanAttribute( ad, subelement, "updatable" );
		copyStringAttribute( ad, subelement, "column-definition", false );
		copyStringAttribute( ad, subelement, "table", false );
		copyIntegerAttribute( ad, subelement, "length" );
		copyIntegerAttribute( ad, subelement, "precision" );
		copyIntegerAttribute( ad, subelement, "scale" );
		annotationList.add( AnnotationFactory.create( ad ) );
	}
}
 
源代码2 项目: lams   文件: MapBinder.java
private void makeOneToManyMapKeyColumnNullableIfNotInProperty(
		final XProperty property) {
	final org.hibernate.mapping.Map map = (org.hibernate.mapping.Map) this.collection;
	if ( map.isOneToMany() &&
			property.isAnnotationPresent( MapKeyColumn.class ) ) {
		final Value indexValue = map.getIndex();
		if ( indexValue.getColumnSpan() != 1 ) {
			throw new AssertionFailure( "Map key mapped by @MapKeyColumn does not have 1 column" );
		}
		final Selectable selectable = indexValue.getColumnIterator().next();
		if ( selectable.isFormula() ) {
			throw new AssertionFailure( "Map key mapped by @MapKeyColumn is a Formula" );
		}
		Column column = (Column) map.getIndex().getColumnIterator().next();
		if ( !column.isNullable() ) {
			final PersistentClass persistentClass = ( ( OneToMany ) map.getElement() ).getAssociatedClass();
			// check if the index column has been mapped by the associated entity to a property;
			// @MapKeyColumn only maps a column to the primary table for the one-to-many, so we only
			// need to check "un-joined" properties.
			if ( !propertyIteratorContainsColumn( persistentClass.getUnjoinedPropertyIterator(), column ) ) {
				// The index column is not mapped to an associated entity property so we can
				// safely make the index column nullable.
				column.setNullable( true );
			}
		}
	}
}
 
源代码3 项目: metacat   文件: Info.java
@ElementCollection
@MapKeyColumn(name = "parameters_idx")
@Column(name = "parameters_elt")
@CollectionTable(name = "info_parameters")
public Map<String, String> getParameters() {
    return parameters;
}
 
源代码4 项目: mycore   文件: MCRJob.java
/**
 * Returns all set parameters of the job.
 * 
 * @return the job parameters
 */
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "MCRJobParameter", joinColumns = @JoinColumn(name = "jobID"))
@MapKeyColumn(name = "paramKey", length = 128)
@Column(name = "paramValue", length = 255)
public Map<String, String> getParameters() {
    return parameters;
}
 
源代码5 项目: pikatimer   文件: TimingLocationInput.java
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name="attribute", insertable=false,updatable=false)
@Column(name="value")
@CollectionTable(name="timing_location_input_attributes", [email protected](name="tli_id"))
@OrderColumn(name = "index_id")
public Map<String, String> getAttributes() {
    //System.out.println("TLI.getAttributes called, returning " + attributes.size() + " attributes");
    return attributes;
}
 
源代码6 项目: pikatimer   文件: Bib2ChipMap.java
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name="chip", insertable=false,updatable=false)
@Column(name="bib")
@CollectionTable(name="bib2chipmap", [email protected](name="bib2chip_id"))
public Map<String, String> getChip2BibMap() {
    //System.out.println("TLI.getAttributes called, returning " + attributes.size() + " attributes");
    return chip2bibMap;
}
 
源代码7 项目: pikatimer   文件: Participant.java
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name="attribute_id")
@Column(name="attribute_value")
@CollectionTable(name="participant_attributes", [email protected](name="participant_id"))
public Map<Integer,String> getCustomAttributes(){
    return customAttributeMap;
}
 
源代码8 项目: pikatimer   文件: EventOptions.java
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name="attribute", insertable=false,updatable=false)
@Column(name="value")
@CollectionTable(name="event_options_attributes", [email protected](name="event_id"))
//@OrderColumn(name = "index_id")
private Map<String, String> getAttributes() {
    System.out.println("EventOptions::getAttributes()");
    attributes.keySet().forEach(k -> {
    System.out.println("  " + k + " -> " + attributes.get(k));
    });
    return attributes;
}
 
源代码9 项目: pikatimer   文件: RaceAwards.java
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name="attribute", insertable=false,updatable=false)
@Column(name="value")
@CollectionTable(name="race_awards_attributes", [email protected](name="race_id"))
@OrderColumn(name = "index_id")
private Map<String, String> getAttributes() {
    return attributes;
}
 
源代码10 项目: pikatimer   文件: Race.java
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name="attribute", insertable=false,updatable=false)
@Column(name="value")
@CollectionTable(name="race_attributes", [email protected](name="race_id"))
private Map<String, String> getAttributes() {
    return attributes;
}
 
源代码11 项目: pikatimer   文件: RaceReport.java
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name="attribute", insertable=false,updatable=false)
@Column(name="value")
@CollectionTable(name="race_output_attributes", [email protected](name="output_id"))
@OrderColumn(name = "id")
private Map<String, String> getAttributes() {
    return attributes;
}
 
源代码12 项目: pikatimer   文件: Result.java
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name="split_id", insertable=false,updatable=false)
@Column(name="split_time",nullable=false)
@CollectionTable(name="split_results", [email protected](name="result_id"))
public Map<Integer,Long> getSplitMap(){
    return splitMap;
}
 
源代码13 项目: lams   文件: MapKeyColumnDelegator.java
public MapKeyColumnDelegator(MapKeyColumn column) {
	this.column = column;
}
 
源代码14 项目: cxf   文件: ServerAuthorizationCodeGrant.java
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name = "extraPropName")
public Map<String, String> getExtraProperties() {
    return extraProperties;
}
 
源代码15 项目: cxf   文件: Client.java
/**
 * Get the list of additional client properties
 * @return the list of properties
 */
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name = "name")
public Map<String, String> getProperties() {
    return properties;
}
 
源代码16 项目: cxf   文件: UserSubject.java
/**
 * Get the list of additional user subject properties
 *
 * @return the list of properties
 */
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name = "name")
public Map<String, String> getProperties() {
    return properties;
}
 
源代码17 项目: cxf   文件: AccessToken.java
/**
 * Gets token parameters
 * @return
 */
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name = "propName")
public Map<String, String> getParameters() {
    return parameters;
}
 
源代码18 项目: cxf   文件: ServerAccessToken.java
@ElementCollection(fetch = FetchType.EAGER)
@MapKeyColumn(name = "extraPropName")
public Map<String, String> getExtraProperties() {
    return extraProperties;
}
 
 类所在包
 同包方法