repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/ReflectionHelper.java | ReflectionHelper.propertyExists | public static boolean propertyExists(Class<?> clazz, String property, ElementType elementType) {
if ( ElementType.FIELD.equals( elementType ) ) {
return getDeclaredField( clazz, property ) != null;
}
else {
String capitalizedPropertyName = capitalize( property );
Method method = getMethod( clazz, PROPER... | java | public static boolean propertyExists(Class<?> clazz, String property, ElementType elementType) {
if ( ElementType.FIELD.equals( elementType ) ) {
return getDeclaredField( clazz, property ) != null;
}
else {
String capitalizedPropertyName = capitalize( property );
Method method = getMethod( clazz, PROPER... | [
"public",
"static",
"boolean",
"propertyExists",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"property",
",",
"ElementType",
"elementType",
")",
"{",
"if",
"(",
"ElementType",
".",
"FIELD",
".",
"equals",
"(",
"elementType",
")",
")",
"{",
"return... | Whether the specified JavaBeans property exists on the given type or not.
@param clazz the type of interest
@param property the JavaBeans property name
@param elementType the element type to check, must be either {@link ElementType#FIELD} or
{@link ElementType#METHOD}.
@return {@code true} if the specified property ex... | [
"Whether",
"the",
"specified",
"JavaBeans",
"property",
"exists",
"on",
"the",
"given",
"type",
"or",
"not",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/ReflectionHelper.java#L65-L84 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/ReflectionHelper.java | ReflectionHelper.setField | public static void setField(Object object, String field, Object value) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
Class<?> clazz = object.getClass();
Method m = clazz.getMethod( PROPERTY_ACCESSOR_PREFIX_SET + capitalize( field ), value.getClass() );
m.invoke( object, value )... | java | public static void setField(Object object, String field, Object value) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
Class<?> clazz = object.getClass();
Method m = clazz.getMethod( PROPERTY_ACCESSOR_PREFIX_SET + capitalize( field ), value.getClass() );
m.invoke( object, value )... | [
"public",
"static",
"void",
"setField",
"(",
"Object",
"object",
",",
"String",
"field",
",",
"Object",
"value",
")",
"throws",
"NoSuchMethodException",
",",
"InvocationTargetException",
",",
"IllegalAccessException",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"... | Set value for given object field.
@param object object to be updated
@param field field name
@param value field value
@throws NoSuchMethodException if property writer is not available
@throws InvocationTargetException if property writer throws an exception
@throws IllegalAccessException if property writer is inaccess... | [
"Set",
"value",
"for",
"given",
"object",
"field",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/ReflectionHelper.java#L127-L131 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/query/parsing/impl/ParserPropertyHelper.java | ParserPropertyHelper.isEmbeddedProperty | public boolean isEmbeddedProperty(String targetTypeName, List<String> namesWithoutAlias) {
OgmEntityPersister persister = getPersister( targetTypeName );
Type propertyType = persister.getPropertyType( namesWithoutAlias.get( 0 ) );
if ( propertyType.isComponentType() ) {
// Embedded
return true;
}
else i... | java | public boolean isEmbeddedProperty(String targetTypeName, List<String> namesWithoutAlias) {
OgmEntityPersister persister = getPersister( targetTypeName );
Type propertyType = persister.getPropertyType( namesWithoutAlias.get( 0 ) );
if ( propertyType.isComponentType() ) {
// Embedded
return true;
}
else i... | [
"public",
"boolean",
"isEmbeddedProperty",
"(",
"String",
"targetTypeName",
",",
"List",
"<",
"String",
">",
"namesWithoutAlias",
")",
"{",
"OgmEntityPersister",
"persister",
"=",
"getPersister",
"(",
"targetTypeName",
")",
";",
"Type",
"propertyType",
"=",
"persist... | Checks if the path leads to an embedded property or association.
@param targetTypeName the entity with the property
@param namesWithoutAlias the path to the property with all the aliases resolved
@return {@code true} if the property is an embedded, {@code false} otherwise. | [
"Checks",
"if",
"the",
"path",
"leads",
"to",
"an",
"embedded",
"property",
"or",
"association",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/query/parsing/impl/ParserPropertyHelper.java#L158-L173 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/query/parsing/impl/ParserPropertyHelper.java | ParserPropertyHelper.isAssociation | public boolean isAssociation(String targetTypeName, List<String> pathWithoutAlias) {
OgmEntityPersister persister = getPersister( targetTypeName );
Type propertyType = persister.getPropertyType( pathWithoutAlias.get( 0 ) );
return propertyType.isAssociationType();
} | java | public boolean isAssociation(String targetTypeName, List<String> pathWithoutAlias) {
OgmEntityPersister persister = getPersister( targetTypeName );
Type propertyType = persister.getPropertyType( pathWithoutAlias.get( 0 ) );
return propertyType.isAssociationType();
} | [
"public",
"boolean",
"isAssociation",
"(",
"String",
"targetTypeName",
",",
"List",
"<",
"String",
">",
"pathWithoutAlias",
")",
"{",
"OgmEntityPersister",
"persister",
"=",
"getPersister",
"(",
"targetTypeName",
")",
";",
"Type",
"propertyType",
"=",
"persister",
... | Check if the path to the property correspond to an association.
@param targetTypeName the name of the entity containing the property
@param pathWithoutAlias the path to the property WITHOUT aliases
@return {@code true} if the property is an association or {@code false} otherwise | [
"Check",
"if",
"the",
"path",
"to",
"the",
"property",
"correspond",
"to",
"an",
"association",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/query/parsing/impl/ParserPropertyHelper.java#L182-L186 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/query/parsing/impl/ParserPropertyHelper.java | ParserPropertyHelper.findAssociationPath | public List<String> findAssociationPath(String targetTypeName, List<String> pathWithoutAlias) {
List<String> subPath = new ArrayList<String>( pathWithoutAlias.size() );
for ( String name : pathWithoutAlias ) {
subPath.add( name );
if ( isAssociation( targetTypeName, subPath ) ) {
return subPath;
}
}
... | java | public List<String> findAssociationPath(String targetTypeName, List<String> pathWithoutAlias) {
List<String> subPath = new ArrayList<String>( pathWithoutAlias.size() );
for ( String name : pathWithoutAlias ) {
subPath.add( name );
if ( isAssociation( targetTypeName, subPath ) ) {
return subPath;
}
}
... | [
"public",
"List",
"<",
"String",
">",
"findAssociationPath",
"(",
"String",
"targetTypeName",
",",
"List",
"<",
"String",
">",
"pathWithoutAlias",
")",
"{",
"List",
"<",
"String",
">",
"subPath",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"pathWithout... | Find the path to the first association in the property path.
@param targetTypeName the entity with the property
@param pathWithoutAlias the path to the property WITHOUT the alias
@return the path to the first association or {@code null} if there isn't an association in the property path | [
"Find",
"the",
"path",
"to",
"the",
"first",
"association",
"in",
"the",
"property",
"path",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/query/parsing/impl/ParserPropertyHelper.java#L195-L204 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/document/association/spi/AssociationRow.java | AssociationRow.buildRowKey | private static <R> RowKey buildRowKey(AssociationKey associationKey, R row, AssociationRowAccessor<R> accessor) {
String[] columnNames = associationKey.getMetadata().getRowKeyColumnNames();
Object[] columnValues = new Object[columnNames.length];
for ( int i = 0; i < columnNames.length; i++ ) {
String columnNa... | java | private static <R> RowKey buildRowKey(AssociationKey associationKey, R row, AssociationRowAccessor<R> accessor) {
String[] columnNames = associationKey.getMetadata().getRowKeyColumnNames();
Object[] columnValues = new Object[columnNames.length];
for ( int i = 0; i < columnNames.length; i++ ) {
String columnNa... | [
"private",
"static",
"<",
"R",
">",
"RowKey",
"buildRowKey",
"(",
"AssociationKey",
"associationKey",
",",
"R",
"row",
",",
"AssociationRowAccessor",
"<",
"R",
">",
"accessor",
")",
"{",
"String",
"[",
"]",
"columnNames",
"=",
"associationKey",
".",
"getMetada... | Creates the row key of the given association row; columns present in the given association key will be obtained
from there, all other columns from the given native association row. | [
"Creates",
"the",
"row",
"key",
"of",
"the",
"given",
"association",
"row",
";",
"columns",
"present",
"in",
"the",
"given",
"association",
"key",
"will",
"be",
"obtained",
"from",
"there",
"all",
"other",
"columns",
"from",
"the",
"given",
"native",
"associ... | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/document/association/spi/AssociationRow.java#L74-L84 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/BaseNeo4jDialect.java | BaseNeo4jDialect.getEntityKey | protected EntityKey getEntityKey(Tuple tuple, AssociatedEntityKeyMetadata associatedEntityKeyMetadata) {
Object[] columnValues = new Object[ associatedEntityKeyMetadata.getAssociationKeyColumns().length];
int i = 0;
for ( String associationKeyColumn : associatedEntityKeyMetadata.getAssociationKeyColumns() ) {
... | java | protected EntityKey getEntityKey(Tuple tuple, AssociatedEntityKeyMetadata associatedEntityKeyMetadata) {
Object[] columnValues = new Object[ associatedEntityKeyMetadata.getAssociationKeyColumns().length];
int i = 0;
for ( String associationKeyColumn : associatedEntityKeyMetadata.getAssociationKeyColumns() ) {
... | [
"protected",
"EntityKey",
"getEntityKey",
"(",
"Tuple",
"tuple",
",",
"AssociatedEntityKeyMetadata",
"associatedEntityKeyMetadata",
")",
"{",
"Object",
"[",
"]",
"columnValues",
"=",
"new",
"Object",
"[",
"associatedEntityKeyMetadata",
".",
"getAssociationKeyColumns",
"("... | Returns the key of the entity targeted by the represented association, retrieved from the given tuple.
@param tuple the tuple from which to retrieve the referenced entity key
@return the key of the entity targeted by the represented association | [
"Returns",
"the",
"key",
"of",
"the",
"entity",
"targeted",
"by",
"the",
"represented",
"association",
"retrieved",
"from",
"the",
"given",
"tuple",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/BaseNeo4jDialect.java#L191-L201 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/BaseNeo4jDialect.java | BaseNeo4jDialect.isPartOfRegularEmbedded | public static boolean isPartOfRegularEmbedded(String[] keyColumnNames, String column) {
return isPartOfEmbedded( column ) && !ArrayHelper.contains( keyColumnNames, column );
} | java | public static boolean isPartOfRegularEmbedded(String[] keyColumnNames, String column) {
return isPartOfEmbedded( column ) && !ArrayHelper.contains( keyColumnNames, column );
} | [
"public",
"static",
"boolean",
"isPartOfRegularEmbedded",
"(",
"String",
"[",
"]",
"keyColumnNames",
",",
"String",
"column",
")",
"{",
"return",
"isPartOfEmbedded",
"(",
"column",
")",
"&&",
"!",
"ArrayHelper",
".",
"contains",
"(",
"keyColumnNames",
",",
"colu... | A regular embedded is an element that it is embedded but it is not a key or a collection.
@param keyColumnNames the column names representing the identifier of the entity
@param column the column we want to check
@return {@code true} if the column represent an attribute of a regular embedded element, {@code false} oth... | [
"A",
"regular",
"embedded",
"is",
"an",
"element",
"that",
"it",
"is",
"embedded",
"but",
"it",
"is",
"not",
"a",
"key",
"or",
"a",
"collection",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/BaseNeo4jDialect.java#L219-L221 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/document/impl/EmbeddableStateFinder.java | EmbeddableStateFinder.getOuterMostNullEmbeddableIfAny | public String getOuterMostNullEmbeddableIfAny(String column) {
String[] path = column.split( "\\." );
if ( !isEmbeddableColumn( path ) ) {
return null;
}
// the cached value may be null hence the explicit key lookup
if ( columnToOuterMostNullEmbeddableCache.containsKey( column ) ) {
return columnToOuter... | java | public String getOuterMostNullEmbeddableIfAny(String column) {
String[] path = column.split( "\\." );
if ( !isEmbeddableColumn( path ) ) {
return null;
}
// the cached value may be null hence the explicit key lookup
if ( columnToOuterMostNullEmbeddableCache.containsKey( column ) ) {
return columnToOuter... | [
"public",
"String",
"getOuterMostNullEmbeddableIfAny",
"(",
"String",
"column",
")",
"{",
"String",
"[",
"]",
"path",
"=",
"column",
".",
"split",
"(",
"\"\\\\.\"",
")",
";",
"if",
"(",
"!",
"isEmbeddableColumn",
"(",
"path",
")",
")",
"{",
"return",
"null... | Should only called on a column that is being set to null.
Returns the most outer embeddable containing {@code column} that is entirely null.
Return null otherwise i.e. not embeddable.
The implementation lazily compute the embeddable state and caches it.
The idea behind the lazy computation is that only some columns w... | [
"Should",
"only",
"called",
"on",
"a",
"column",
"that",
"is",
"being",
"set",
"to",
"null",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/document/impl/EmbeddableStateFinder.java#L48-L58 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/document/impl/EmbeddableStateFinder.java | EmbeddableStateFinder.determineAndCacheOuterMostNullEmbeddable | private String determineAndCacheOuterMostNullEmbeddable(String column, String[] path) {
String embeddable = path[0];
// process each embeddable from less specific to most specific
// exclude path leaves as it's a column and not an embeddable
for ( int index = 0; index < path.length - 1; index++ ) {
Set<Strin... | java | private String determineAndCacheOuterMostNullEmbeddable(String column, String[] path) {
String embeddable = path[0];
// process each embeddable from less specific to most specific
// exclude path leaves as it's a column and not an embeddable
for ( int index = 0; index < path.length - 1; index++ ) {
Set<Strin... | [
"private",
"String",
"determineAndCacheOuterMostNullEmbeddable",
"(",
"String",
"column",
",",
"String",
"[",
"]",
"path",
")",
"{",
"String",
"embeddable",
"=",
"path",
"[",
"0",
"]",
";",
"// process each embeddable from less specific to most specific",
"// exclude path... | Walks from the most outer embeddable to the most inner one
look for all columns contained in these embeddables
and exclude the embeddables that have a non null column
because of caching, the algorithm is only run once per column parameter | [
"Walks",
"from",
"the",
"most",
"outer",
"embeddable",
"to",
"the",
"most",
"inner",
"one",
"look",
"for",
"all",
"columns",
"contained",
"in",
"these",
"embeddables",
"and",
"exclude",
"the",
"embeddables",
"that",
"have",
"a",
"non",
"null",
"column",
"bec... | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/document/impl/EmbeddableStateFinder.java#L66-L87 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/EntityAssociationUpdater.java | EntityAssociationUpdater.addNavigationalInformationForInverseSide | public void addNavigationalInformationForInverseSide() {
if ( log.isTraceEnabled() ) {
log.trace( "Adding inverse navigational information for entity: " + MessageHelper.infoString( persister, id, persister.getFactory() ) );
}
for ( int propertyIndex = 0; propertyIndex < persister.getEntityMetamodel().getPrope... | java | public void addNavigationalInformationForInverseSide() {
if ( log.isTraceEnabled() ) {
log.trace( "Adding inverse navigational information for entity: " + MessageHelper.infoString( persister, id, persister.getFactory() ) );
}
for ( int propertyIndex = 0; propertyIndex < persister.getEntityMetamodel().getPrope... | [
"public",
"void",
"addNavigationalInformationForInverseSide",
"(",
")",
"{",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"log",
".",
"trace",
"(",
"\"Adding inverse navigational information for entity: \"",
"+",
"MessageHelper",
".",
"infoString",
"("... | Updates all inverse associations managed by a given entity. | [
"Updates",
"all",
"inverse",
"associations",
"managed",
"by",
"a",
"given",
"entity",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/EntityAssociationUpdater.java#L97-L122 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/StringHelper.java | StringHelper.escapeDoubleQuotesForJson | public static String escapeDoubleQuotesForJson(String text) {
if ( text == null ) {
return null;
}
StringBuilder builder = new StringBuilder( text.length() );
for ( int i = 0; i < text.length(); i++ ) {
char c = text.charAt( i );
switch ( c ) {
case '"':
case '\\':
builder.append( "\\" );
... | java | public static String escapeDoubleQuotesForJson(String text) {
if ( text == null ) {
return null;
}
StringBuilder builder = new StringBuilder( text.length() );
for ( int i = 0; i < text.length(); i++ ) {
char c = text.charAt( i );
switch ( c ) {
case '"':
case '\\':
builder.append( "\\" );
... | [
"public",
"static",
"String",
"escapeDoubleQuotesForJson",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"text",
".",
"length",
"(",
")"... | If a text contains double quotes, escape them.
@param text the text to escape
@return Escaped text or {@code null} if the text is null | [
"If",
"a",
"text",
"contains",
"double",
"quotes",
"escape",
"them",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/StringHelper.java#L89-L105 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/http/dialect/impl/HttpNeo4jEntityQueries.java | HttpNeo4jEntityQueries.row | private static Row row(List<StatementResult> results) {
Row row = results.get( 0 ).getData().get( 0 );
return row;
} | java | private static Row row(List<StatementResult> results) {
Row row = results.get( 0 ).getData().get( 0 );
return row;
} | [
"private",
"static",
"Row",
"row",
"(",
"List",
"<",
"StatementResult",
">",
"results",
")",
"{",
"Row",
"row",
"=",
"results",
".",
"get",
"(",
"0",
")",
".",
"getData",
"(",
")",
".",
"get",
"(",
"0",
")",
";",
"return",
"row",
";",
"}"
] | When we execute a single statement we only need the corresponding Row with the result.
@param results a list of {@link StatementResult}
@return the result of a single query | [
"When",
"we",
"execute",
"a",
"single",
"statement",
"we",
"only",
"need",
"the",
"corresponding",
"Row",
"with",
"the",
"result",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/http/dialect/impl/HttpNeo4jEntityQueries.java#L342-L345 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/dialect/impl/GridDialects.java | GridDialects.getDialectFacetOrNull | static <T extends GridDialect> T getDialectFacetOrNull(GridDialect gridDialect, Class<T> facetType) {
if ( hasFacet( gridDialect, facetType ) ) {
@SuppressWarnings("unchecked")
T asFacet = (T) gridDialect;
return asFacet;
}
return null;
} | java | static <T extends GridDialect> T getDialectFacetOrNull(GridDialect gridDialect, Class<T> facetType) {
if ( hasFacet( gridDialect, facetType ) ) {
@SuppressWarnings("unchecked")
T asFacet = (T) gridDialect;
return asFacet;
}
return null;
} | [
"static",
"<",
"T",
"extends",
"GridDialect",
">",
"T",
"getDialectFacetOrNull",
"(",
"GridDialect",
"gridDialect",
",",
"Class",
"<",
"T",
">",
"facetType",
")",
"{",
"if",
"(",
"hasFacet",
"(",
"gridDialect",
",",
"facetType",
")",
")",
"{",
"@",
"Suppre... | Returns the given dialect, narrowed down to the given dialect facet in case it is implemented by the dialect.
@param gridDialect the dialect of interest
@param facetType the dialect facet type of interest
@return the given dialect, narrowed down to the given dialect facet or {@code null} in case the given dialect
does... | [
"Returns",
"the",
"given",
"dialect",
"narrowed",
"down",
"to",
"the",
"given",
"dialect",
"facet",
"in",
"case",
"it",
"is",
"implemented",
"by",
"the",
"dialect",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/dialect/impl/GridDialects.java#L37-L45 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/dialect/impl/GridDialects.java | GridDialects.hasFacet | public static boolean hasFacet(GridDialect gridDialect, Class<? extends GridDialect> facetType) {
if ( gridDialect instanceof ForwardingGridDialect ) {
return hasFacet( ( (ForwardingGridDialect<?>) gridDialect ).getGridDialect(), facetType );
}
else {
return facetType.isAssignableFrom( gridDialect.getClass(... | java | public static boolean hasFacet(GridDialect gridDialect, Class<? extends GridDialect> facetType) {
if ( gridDialect instanceof ForwardingGridDialect ) {
return hasFacet( ( (ForwardingGridDialect<?>) gridDialect ).getGridDialect(), facetType );
}
else {
return facetType.isAssignableFrom( gridDialect.getClass(... | [
"public",
"static",
"boolean",
"hasFacet",
"(",
"GridDialect",
"gridDialect",
",",
"Class",
"<",
"?",
"extends",
"GridDialect",
">",
"facetType",
")",
"{",
"if",
"(",
"gridDialect",
"instanceof",
"ForwardingGridDialect",
")",
"{",
"return",
"hasFacet",
"(",
"(",... | Whether the given grid dialect implements the specified facet or not.
@param gridDialect the dialect of interest
@param facetType the dialect facet type of interest
@return {@code true} in case the given dialect implements the specified facet, {@code false} otherwise | [
"Whether",
"the",
"given",
"grid",
"dialect",
"implements",
"the",
"specified",
"facet",
"or",
"not",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/dialect/impl/GridDialects.java#L54-L61 | train |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/impl/InfinispanEmbeddedDatastoreProvider.java | InfinispanEmbeddedDatastoreProvider.initializePersistenceStrategy | public void initializePersistenceStrategy(CacheMappingType cacheMappingType, Set<EntityKeyMetadata> entityTypes, Set<AssociationKeyMetadata> associationTypes, Set<IdSourceKeyMetadata> idSourceTypes, Iterable<Namespace> namespaces) {
persistenceStrategy = PersistenceStrategy.getInstance(
cacheMappingType,
exte... | java | public void initializePersistenceStrategy(CacheMappingType cacheMappingType, Set<EntityKeyMetadata> entityTypes, Set<AssociationKeyMetadata> associationTypes, Set<IdSourceKeyMetadata> idSourceTypes, Iterable<Namespace> namespaces) {
persistenceStrategy = PersistenceStrategy.getInstance(
cacheMappingType,
exte... | [
"public",
"void",
"initializePersistenceStrategy",
"(",
"CacheMappingType",
"cacheMappingType",
",",
"Set",
"<",
"EntityKeyMetadata",
">",
"entityTypes",
",",
"Set",
"<",
"AssociationKeyMetadata",
">",
"associationTypes",
",",
"Set",
"<",
"IdSourceKeyMetadata",
">",
"id... | Initializes the persistence strategy to be used when accessing the datastore. In particular, all the required
caches will be configured and initialized.
@param cacheMappingType the {@link org.hibernate.ogm.datastore.keyvalue.options.CacheMappingType} to be used
@param entityTypes meta-data of all the entity types regi... | [
"Initializes",
"the",
"persistence",
"strategy",
"to",
"be",
"used",
"when",
"accessing",
"the",
"datastore",
".",
"In",
"particular",
"all",
"the",
"required",
"caches",
"will",
"be",
"configured",
"and",
"initialized",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/impl/InfinispanEmbeddedDatastoreProvider.java#L108-L136 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java | MongoDBDialect.getProjection | private static Document getProjection(List<String> fieldNames) {
Document projection = new Document();
for ( String column : fieldNames ) {
projection.put( column, 1 );
}
return projection;
} | java | private static Document getProjection(List<String> fieldNames) {
Document projection = new Document();
for ( String column : fieldNames ) {
projection.put( column, 1 );
}
return projection;
} | [
"private",
"static",
"Document",
"getProjection",
"(",
"List",
"<",
"String",
">",
"fieldNames",
")",
"{",
"Document",
"projection",
"=",
"new",
"Document",
"(",
")",
";",
"for",
"(",
"String",
"column",
":",
"fieldNames",
")",
"{",
"projection",
".",
"put... | Returns a projection object for specifying the fields to retrieve during a specific find operation. | [
"Returns",
"a",
"projection",
"object",
"for",
"specifying",
"the",
"fields",
"to",
"retrieve",
"during",
"a",
"specific",
"find",
"operation",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java#L365-L372 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java | MongoDBDialect.objectForInsert | private static Document objectForInsert(Tuple tuple, Document dbObject) {
MongoDBTupleSnapshot snapshot = (MongoDBTupleSnapshot) tuple.getSnapshot();
for ( TupleOperation operation : tuple.getOperations() ) {
String column = operation.getColumn();
if ( notInIdField( snapshot, column ) ) {
switch ( operati... | java | private static Document objectForInsert(Tuple tuple, Document dbObject) {
MongoDBTupleSnapshot snapshot = (MongoDBTupleSnapshot) tuple.getSnapshot();
for ( TupleOperation operation : tuple.getOperations() ) {
String column = operation.getColumn();
if ( notInIdField( snapshot, column ) ) {
switch ( operati... | [
"private",
"static",
"Document",
"objectForInsert",
"(",
"Tuple",
"tuple",
",",
"Document",
"dbObject",
")",
"{",
"MongoDBTupleSnapshot",
"snapshot",
"=",
"(",
"MongoDBTupleSnapshot",
")",
"tuple",
".",
"getSnapshot",
"(",
")",
";",
"for",
"(",
"TupleOperation",
... | Creates a Document that can be passed to the MongoDB batch insert function | [
"Creates",
"a",
"Document",
"that",
"can",
"be",
"passed",
"to",
"the",
"MongoDB",
"batch",
"insert",
"function"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java#L554-L571 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java | MongoDBDialect.doDistinct | private static ClosableIterator<Tuple> doDistinct(final MongoDBQueryDescriptor queryDescriptor, final MongoCollection<Document> collection) {
DistinctIterable<?> distinctFieldValues = collection.distinct( queryDescriptor.getDistinctFieldName(), queryDescriptor.getCriteria(), String.class );
Collation collation = ge... | java | private static ClosableIterator<Tuple> doDistinct(final MongoDBQueryDescriptor queryDescriptor, final MongoCollection<Document> collection) {
DistinctIterable<?> distinctFieldValues = collection.distinct( queryDescriptor.getDistinctFieldName(), queryDescriptor.getCriteria(), String.class );
Collation collation = ge... | [
"private",
"static",
"ClosableIterator",
"<",
"Tuple",
">",
"doDistinct",
"(",
"final",
"MongoDBQueryDescriptor",
"queryDescriptor",
",",
"final",
"MongoCollection",
"<",
"Document",
">",
"collection",
")",
"{",
"DistinctIterable",
"<",
"?",
">",
"distinctFieldValues"... | do 'Distinct' operation
@param queryDescriptor descriptor of MongoDB query
@param collection collection for execute the operation
@return result iterator
@see <a href ="https://docs.mongodb.com/manual/reference/method/db.collection.distinct/">distinct</a> | [
"do",
"Distinct",
"operation"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java#L1106-L1119 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java | MongoDBDialect.mergeWriteConcern | @SuppressWarnings("deprecation")
private static WriteConcern mergeWriteConcern(WriteConcern original, WriteConcern writeConcern) {
if ( original == null ) {
return writeConcern;
}
else if ( writeConcern == null ) {
return original;
}
else if ( original.equals( writeConcern ) ) {
return original;
}... | java | @SuppressWarnings("deprecation")
private static WriteConcern mergeWriteConcern(WriteConcern original, WriteConcern writeConcern) {
if ( original == null ) {
return writeConcern;
}
else if ( writeConcern == null ) {
return original;
}
else if ( original.equals( writeConcern ) ) {
return original;
}... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"static",
"WriteConcern",
"mergeWriteConcern",
"(",
"WriteConcern",
"original",
",",
"WriteConcern",
"writeConcern",
")",
"{",
"if",
"(",
"original",
"==",
"null",
")",
"{",
"return",
"writeConcern",
... | As we merge several operations into one operation, we need to be sure the write concern applied to the aggregated
operation respects all the requirements expressed for each separate operation.
Thus, for each parameter of the write concern, we keep the stricter one for the resulting merged write concern. | [
"As",
"we",
"merge",
"several",
"operations",
"into",
"one",
"operation",
"we",
"need",
"to",
"be",
"sure",
"the",
"write",
"concern",
"applied",
"to",
"the",
"aggregated",
"operation",
"respects",
"all",
"the",
"requirements",
"expressed",
"for",
"each",
"sep... | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java#L1807-L1854 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java | MongoDBDialect.callStoredProcedure | @Override
public ClosableIterator<Tuple> callStoredProcedure(String storedProcedureName, ProcedureQueryParameters params, TupleContext tupleContext) {
validate( params );
StringBuilder commandLine = createCallStoreProcedureCommand( storedProcedureName, params );
Document result = callStoredProcedure( commandLine... | java | @Override
public ClosableIterator<Tuple> callStoredProcedure(String storedProcedureName, ProcedureQueryParameters params, TupleContext tupleContext) {
validate( params );
StringBuilder commandLine = createCallStoreProcedureCommand( storedProcedureName, params );
Document result = callStoredProcedure( commandLine... | [
"@",
"Override",
"public",
"ClosableIterator",
"<",
"Tuple",
">",
"callStoredProcedure",
"(",
"String",
"storedProcedureName",
",",
"ProcedureQueryParameters",
"params",
",",
"TupleContext",
"tupleContext",
")",
"{",
"validate",
"(",
"params",
")",
";",
"StringBuilder... | In MongoDB the equivalent of a stored procedure is a stored Javascript.
@param storedProcedureName name of stored procedure
@param params query parameters
@param tupleContext the tuple context
@return the result as a {@link ClosableIterator} | [
"In",
"MongoDB",
"the",
"equivalent",
"of",
"a",
"stored",
"procedure",
"is",
"a",
"stored",
"Javascript",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java#L1865-L1873 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/entity/impl/BatchingEntityLoaderBuilder.java | BatchingEntityLoaderBuilder.buildLoader | public UniqueEntityLoader buildLoader(
OuterJoinLoadable persister,
int batchSize,
LockMode lockMode,
SessionFactoryImplementor factory,
LoadQueryInfluencers influencers,
BatchableEntityLoaderBuilder innerEntityLoaderBuilder) {
if ( batchSize <= 1 ) {
// no batching
return buildNonBatchingLoad... | java | public UniqueEntityLoader buildLoader(
OuterJoinLoadable persister,
int batchSize,
LockMode lockMode,
SessionFactoryImplementor factory,
LoadQueryInfluencers influencers,
BatchableEntityLoaderBuilder innerEntityLoaderBuilder) {
if ( batchSize <= 1 ) {
// no batching
return buildNonBatchingLoad... | [
"public",
"UniqueEntityLoader",
"buildLoader",
"(",
"OuterJoinLoadable",
"persister",
",",
"int",
"batchSize",
",",
"LockMode",
"lockMode",
",",
"SessionFactoryImplementor",
"factory",
",",
"LoadQueryInfluencers",
"influencers",
",",
"BatchableEntityLoaderBuilder",
"innerEnti... | Builds a batch-fetch capable loader based on the given persister, lock-mode, etc.
@param persister The entity persister
@param batchSize The maximum number of ids to batch-fetch at once
@param lockMode The lock mode
@param factory The SessionFactory
@param influencers Any influencers that should affect the built query... | [
"Builds",
"a",
"batch",
"-",
"fetch",
"capable",
"loader",
"based",
"on",
"the",
"given",
"persister",
"lock",
"-",
"mode",
"etc",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/entity/impl/BatchingEntityLoaderBuilder.java#L89-L101 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/entity/impl/BatchingEntityLoaderBuilder.java | BatchingEntityLoaderBuilder.buildLoader | public UniqueEntityLoader buildLoader(
OuterJoinLoadable persister,
int batchSize,
LockOptions lockOptions,
SessionFactoryImplementor factory,
LoadQueryInfluencers influencers,
BatchableEntityLoaderBuilder innerEntityLoaderBuilder) {
if ( batchSize <= 1 ) {
// no batching
return buildNonBatchi... | java | public UniqueEntityLoader buildLoader(
OuterJoinLoadable persister,
int batchSize,
LockOptions lockOptions,
SessionFactoryImplementor factory,
LoadQueryInfluencers influencers,
BatchableEntityLoaderBuilder innerEntityLoaderBuilder) {
if ( batchSize <= 1 ) {
// no batching
return buildNonBatchi... | [
"public",
"UniqueEntityLoader",
"buildLoader",
"(",
"OuterJoinLoadable",
"persister",
",",
"int",
"batchSize",
",",
"LockOptions",
"lockOptions",
",",
"SessionFactoryImplementor",
"factory",
",",
"LoadQueryInfluencers",
"influencers",
",",
"BatchableEntityLoaderBuilder",
"inn... | Builds a batch-fetch capable loader based on the given persister, lock-options, etc.
@param persister The entity persister
@param batchSize The maximum number of ids to batch-fetch at once
@param lockOptions The lock options
@param factory The SessionFactory
@param influencers Any influencers that should affect the bu... | [
"Builds",
"a",
"batch",
"-",
"fetch",
"capable",
"loader",
"based",
"on",
"the",
"given",
"persister",
"lock",
"-",
"options",
"etc",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/entity/impl/BatchingEntityLoaderBuilder.java#L141-L153 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/EmbeddedNeo4jDialect.java | EmbeddedNeo4jDialect.applyProperties | private void applyProperties(AssociationKey associationKey, Tuple associationRow, Relationship relationship) {
String[] indexColumns = associationKey.getMetadata().getRowKeyIndexColumnNames();
for ( int i = 0; i < indexColumns.length; i++ ) {
String propertyName = indexColumns[i];
Object propertyValue = assoc... | java | private void applyProperties(AssociationKey associationKey, Tuple associationRow, Relationship relationship) {
String[] indexColumns = associationKey.getMetadata().getRowKeyIndexColumnNames();
for ( int i = 0; i < indexColumns.length; i++ ) {
String propertyName = indexColumns[i];
Object propertyValue = assoc... | [
"private",
"void",
"applyProperties",
"(",
"AssociationKey",
"associationKey",
",",
"Tuple",
"associationRow",
",",
"Relationship",
"relationship",
")",
"{",
"String",
"[",
"]",
"indexColumns",
"=",
"associationKey",
".",
"getMetadata",
"(",
")",
".",
"getRowKeyInde... | The only properties added to a relationship are the columns representing the index of the association. | [
"The",
"only",
"properties",
"added",
"to",
"a",
"relationship",
"are",
"the",
"columns",
"representing",
"the",
"index",
"of",
"the",
"association",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/EmbeddedNeo4jDialect.java#L276-L283 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/entityentry/impl/OgmEntityEntryState.java | OgmEntityEntryState.getAssociation | public Association getAssociation(String collectionRole) {
if ( associations == null ) {
return null;
}
return associations.get( collectionRole );
} | java | public Association getAssociation(String collectionRole) {
if ( associations == null ) {
return null;
}
return associations.get( collectionRole );
} | [
"public",
"Association",
"getAssociation",
"(",
"String",
"collectionRole",
")",
"{",
"if",
"(",
"associations",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"associations",
".",
"get",
"(",
"collectionRole",
")",
";",
"}"
] | Return the association as cached in the entry state.
@param collectionRole the role of the association
@return the cached association | [
"Return",
"the",
"association",
"as",
"cached",
"in",
"the",
"entry",
"state",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/entityentry/impl/OgmEntityEntryState.java#L50-L55 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/entityentry/impl/OgmEntityEntryState.java | OgmEntityEntryState.setAssociation | public void setAssociation(String collectionRole, Association association) {
if ( associations == null ) {
associations = new HashMap<>();
}
associations.put( collectionRole, association );
} | java | public void setAssociation(String collectionRole, Association association) {
if ( associations == null ) {
associations = new HashMap<>();
}
associations.put( collectionRole, association );
} | [
"public",
"void",
"setAssociation",
"(",
"String",
"collectionRole",
",",
"Association",
"association",
")",
"{",
"if",
"(",
"associations",
"==",
"null",
")",
"{",
"associations",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"}",
"associations",
".",
"put",
... | Set the association in the entry state.
@param collectionRole the role of the association
@param association the association | [
"Set",
"the",
"association",
"in",
"the",
"entry",
"state",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/entityentry/impl/OgmEntityEntryState.java#L76-L81 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/entityentry/impl/OgmEntityEntryState.java | OgmEntityEntryState.addExtraState | @Override
public void addExtraState(EntityEntryExtraState extraState) {
if ( next == null ) {
next = extraState;
}
else {
next.addExtraState( extraState );
}
} | java | @Override
public void addExtraState(EntityEntryExtraState extraState) {
if ( next == null ) {
next = extraState;
}
else {
next.addExtraState( extraState );
}
} | [
"@",
"Override",
"public",
"void",
"addExtraState",
"(",
"EntityEntryExtraState",
"extraState",
")",
"{",
"if",
"(",
"next",
"==",
"null",
")",
"{",
"next",
"=",
"extraState",
";",
"}",
"else",
"{",
"next",
".",
"addExtraState",
"(",
"extraState",
")",
";"... | state chain management ops below | [
"state",
"chain",
"management",
"ops",
"below"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/entityentry/impl/OgmEntityEntryState.java#L100-L108 | train |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/counter/ClusteredCounterHandler.java | ClusteredCounterHandler.getCounterOrCreateIt | protected StrongCounter getCounterOrCreateIt(String counterName, int initialValue) {
CounterManager counterManager = EmbeddedCounterManagerFactory.asCounterManager( cacheManager );
if ( !counterManager.isDefined( counterName ) ) {
LOG.tracef( "Counter %s is not defined, creating it", counterName );
// global... | java | protected StrongCounter getCounterOrCreateIt(String counterName, int initialValue) {
CounterManager counterManager = EmbeddedCounterManagerFactory.asCounterManager( cacheManager );
if ( !counterManager.isDefined( counterName ) ) {
LOG.tracef( "Counter %s is not defined, creating it", counterName );
// global... | [
"protected",
"StrongCounter",
"getCounterOrCreateIt",
"(",
"String",
"counterName",
",",
"int",
"initialValue",
")",
"{",
"CounterManager",
"counterManager",
"=",
"EmbeddedCounterManagerFactory",
".",
"asCounterManager",
"(",
"cacheManager",
")",
";",
"if",
"(",
"!",
... | Create a counter if one is not defined already, otherwise return the existing one.
@param counterName unique name for the counter
@param initialValue initial value for the counter
@return a {@link StrongCounter} | [
"Create",
"a",
"counter",
"if",
"one",
"is",
"not",
"defined",
"already",
"otherwise",
"return",
"the",
"existing",
"one",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/counter/ClusteredCounterHandler.java#L47-L66 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/model/spi/Tuple.java | Tuple.getOperations | public Set<TupleOperation> getOperations() {
if ( currentState == null ) {
return Collections.emptySet();
}
else {
return new SetFromCollection<TupleOperation>( currentState.values() );
}
} | java | public Set<TupleOperation> getOperations() {
if ( currentState == null ) {
return Collections.emptySet();
}
else {
return new SetFromCollection<TupleOperation>( currentState.values() );
}
} | [
"public",
"Set",
"<",
"TupleOperation",
">",
"getOperations",
"(",
")",
"{",
"if",
"(",
"currentState",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"}",
"else",
"{",
"return",
"new",
"SetFromCollection",
"<",
"TupleOper... | Return the list of actions on the tuple.
Inherently deduplicated operations
@return the operations to execute on the Tuple | [
"Return",
"the",
"list",
"of",
"actions",
"on",
"the",
"tuple",
".",
"Inherently",
"deduplicated",
"operations"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/model/spi/Tuple.java#L104-L111 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/options/navigation/source/impl/AnnotationOptionValueSource.java | AnnotationOptionValueSource.getConverter | private <A extends Annotation> AnnotationConverter<A> getConverter(Annotation annotation) {
MappingOption mappingOption = annotation.annotationType().getAnnotation( MappingOption.class );
if ( mappingOption == null ) {
return null;
}
// wrong type would be a programming error of the annotation developer
@... | java | private <A extends Annotation> AnnotationConverter<A> getConverter(Annotation annotation) {
MappingOption mappingOption = annotation.annotationType().getAnnotation( MappingOption.class );
if ( mappingOption == null ) {
return null;
}
// wrong type would be a programming error of the annotation developer
@... | [
"private",
"<",
"A",
"extends",
"Annotation",
">",
"AnnotationConverter",
"<",
"A",
">",
"getConverter",
"(",
"Annotation",
"annotation",
")",
"{",
"MappingOption",
"mappingOption",
"=",
"annotation",
".",
"annotationType",
"(",
")",
".",
"getAnnotation",
"(",
"... | Returns a converter instance for the given annotation.
@param annotation the annotation
@return a converter instance or {@code null} if the given annotation is no option annotation | [
"Returns",
"a",
"converter",
"instance",
"for",
"the",
"given",
"annotation",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/options/navigation/source/impl/AnnotationOptionValueSource.java#L115-L131 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/ArrayHelper.java | ArrayHelper.slice | public static String[] slice(String[] strings, int begin, int length) {
String[] result = new String[length];
System.arraycopy( strings, begin, result, 0, length );
return result;
} | java | public static String[] slice(String[] strings, int begin, int length) {
String[] result = new String[length];
System.arraycopy( strings, begin, result, 0, length );
return result;
} | [
"public",
"static",
"String",
"[",
"]",
"slice",
"(",
"String",
"[",
"]",
"strings",
",",
"int",
"begin",
",",
"int",
"length",
")",
"{",
"String",
"[",
"]",
"result",
"=",
"new",
"String",
"[",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
... | Create a smaller array from an existing one.
@param strings an array containing element of type {@link String}
@param begin the starting position of the sub-array
@param length the number of element to consider
@return a new array continaining only the selected elements | [
"Create",
"a",
"smaller",
"array",
"from",
"an",
"existing",
"one",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/ArrayHelper.java#L37-L41 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/ArrayHelper.java | ArrayHelper.indexOf | public static <T> int indexOf(T[] array, T element) {
for ( int i = 0; i < array.length; i++ ) {
if ( array[i].equals( element ) ) {
return i;
}
}
return -1;
} | java | public static <T> int indexOf(T[] array, T element) {
for ( int i = 0; i < array.length; i++ ) {
if ( array[i].equals( element ) ) {
return i;
}
}
return -1;
} | [
"public",
"static",
"<",
"T",
">",
"int",
"indexOf",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"element",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"array",
"[",
"i"... | Return the position of an element inside an array
@param array the array where it looks for an element
@param element the element to find in the array
@param <T> the type of elements in the array
@return the position of the element if it's found in the array, -1 otherwise | [
"Return",
"the",
"position",
"of",
"an",
"element",
"inside",
"an",
"array"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/ArrayHelper.java#L51-L58 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/ArrayHelper.java | ArrayHelper.concat | public static <T> T[] concat(T[] first, T... second) {
int firstLength = first.length;
int secondLength = second.length;
@SuppressWarnings("unchecked")
T[] result = (T[]) Array.newInstance( first.getClass().getComponentType(), firstLength + secondLength );
System.arraycopy( first, 0, result, 0, firstLength )... | java | public static <T> T[] concat(T[] first, T... second) {
int firstLength = first.length;
int secondLength = second.length;
@SuppressWarnings("unchecked")
T[] result = (T[]) Array.newInstance( first.getClass().getComponentType(), firstLength + secondLength );
System.arraycopy( first, 0, result, 0, firstLength )... | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"concat",
"(",
"T",
"[",
"]",
"first",
",",
"T",
"...",
"second",
")",
"{",
"int",
"firstLength",
"=",
"first",
".",
"length",
";",
"int",
"secondLength",
"=",
"second",
".",
"length",
";",
"@",
"... | Concats two arrays.
@param first the first array
@param second the second array
@param <T> the type of the element in the array
@return a new array created adding the element in the second array after the first one | [
"Concats",
"two",
"arrays",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/ArrayHelper.java#L79-L89 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/ArrayHelper.java | ArrayHelper.concat | public static <T> T[] concat(T firstElement, T... array) {
@SuppressWarnings("unchecked")
T[] result = (T[]) Array.newInstance( firstElement.getClass(), 1 + array.length );
result[0] = firstElement;
System.arraycopy( array, 0, result, 1, array.length );
return result;
} | java | public static <T> T[] concat(T firstElement, T... array) {
@SuppressWarnings("unchecked")
T[] result = (T[]) Array.newInstance( firstElement.getClass(), 1 + array.length );
result[0] = firstElement;
System.arraycopy( array, 0, result, 1, array.length );
return result;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"concat",
"(",
"T",
"firstElement",
",",
"T",
"...",
"array",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"T",
"[",
"]",
"result",
"=",
"(",
"T",
"[",
"]",
")",
"Array",
".",
"ne... | Concats an element and an array.
@param firstElement the first element
@param array the array
@param <T> the type of the element in the array
@return a new array created adding the element in the second array after the first element | [
"Concats",
"an",
"element",
"and",
"an",
"array",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/ArrayHelper.java#L123-L130 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/id/impl/OgmGeneratorBase.java | OgmGeneratorBase.doWorkInIsolationTransaction | private Serializable doWorkInIsolationTransaction(final SharedSessionContractImplementor session)
throws HibernateException {
class Work extends AbstractReturningWork<IntegralDataTypeHolder> {
private final SharedSessionContractImplementor localSession = session;
@Override
public IntegralDataTypeHolder e... | java | private Serializable doWorkInIsolationTransaction(final SharedSessionContractImplementor session)
throws HibernateException {
class Work extends AbstractReturningWork<IntegralDataTypeHolder> {
private final SharedSessionContractImplementor localSession = session;
@Override
public IntegralDataTypeHolder e... | [
"private",
"Serializable",
"doWorkInIsolationTransaction",
"(",
"final",
"SharedSessionContractImplementor",
"session",
")",
"throws",
"HibernateException",
"{",
"class",
"Work",
"extends",
"AbstractReturningWork",
"<",
"IntegralDataTypeHolder",
">",
"{",
"private",
"final",
... | copied and altered from TransactionHelper | [
"copied",
"and",
"altered",
"from",
"TransactionHelper"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/id/impl/OgmGeneratorBase.java#L132-L152 | train |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/ExternalizersIntegration.java | ExternalizersIntegration.registerOgmExternalizers | public static void registerOgmExternalizers(SerializationConfigurationBuilder cfg) {
for ( AdvancedExternalizer<?> advancedExternalizer : ogmExternalizers.values() ) {
cfg.addAdvancedExternalizer( advancedExternalizer );
}
} | java | public static void registerOgmExternalizers(SerializationConfigurationBuilder cfg) {
for ( AdvancedExternalizer<?> advancedExternalizer : ogmExternalizers.values() ) {
cfg.addAdvancedExternalizer( advancedExternalizer );
}
} | [
"public",
"static",
"void",
"registerOgmExternalizers",
"(",
"SerializationConfigurationBuilder",
"cfg",
")",
"{",
"for",
"(",
"AdvancedExternalizer",
"<",
"?",
">",
"advancedExternalizer",
":",
"ogmExternalizers",
".",
"values",
"(",
")",
")",
"{",
"cfg",
".",
"a... | Registers all custom Externalizer implementations that Hibernate OGM needs into an Infinispan CacheManager
configuration.
@see ExternalizerIds
@param cfg the Serialization section of a GlobalConfiguration builder | [
"Registers",
"all",
"custom",
"Externalizer",
"implementations",
"that",
"Hibernate",
"OGM",
"needs",
"into",
"an",
"Infinispan",
"CacheManager",
"configuration",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/ExternalizersIntegration.java#L76-L80 | train |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/ExternalizersIntegration.java | ExternalizersIntegration.registerOgmExternalizers | public static void registerOgmExternalizers(GlobalConfiguration globalCfg) {
Map<Integer, AdvancedExternalizer<?>> externalizerMap = globalCfg.serialization().advancedExternalizers();
externalizerMap.putAll( ogmExternalizers );
} | java | public static void registerOgmExternalizers(GlobalConfiguration globalCfg) {
Map<Integer, AdvancedExternalizer<?>> externalizerMap = globalCfg.serialization().advancedExternalizers();
externalizerMap.putAll( ogmExternalizers );
} | [
"public",
"static",
"void",
"registerOgmExternalizers",
"(",
"GlobalConfiguration",
"globalCfg",
")",
"{",
"Map",
"<",
"Integer",
",",
"AdvancedExternalizer",
"<",
"?",
">",
">",
"externalizerMap",
"=",
"globalCfg",
".",
"serialization",
"(",
")",
".",
"advancedEx... | Registers all custom Externalizer implementations that Hibernate OGM needs into a running
Infinispan CacheManager configuration.
This is only safe to do when Caches from this CacheManager haven't been started yet,
or the ones already started do not contain any data needing these.
@see ExternalizerIds
@param globalCfg ... | [
"Registers",
"all",
"custom",
"Externalizer",
"implementations",
"that",
"Hibernate",
"OGM",
"needs",
"into",
"a",
"running",
"Infinispan",
"CacheManager",
"configuration",
".",
"This",
"is",
"only",
"safe",
"to",
"do",
"when",
"Caches",
"from",
"this",
"CacheMana... | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/ExternalizersIntegration.java#L91-L94 | train |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/ExternalizersIntegration.java | ExternalizersIntegration.validateExternalizersPresent | public static void validateExternalizersPresent(EmbeddedCacheManager externalCacheManager) {
Map<Integer, AdvancedExternalizer<?>> externalizerMap = externalCacheManager
.getCacheManagerConfiguration()
.serialization()
.advancedExternalizers();
for ( AdvancedExternalizer<?> ogmExternalizer : ogmExternal... | java | public static void validateExternalizersPresent(EmbeddedCacheManager externalCacheManager) {
Map<Integer, AdvancedExternalizer<?>> externalizerMap = externalCacheManager
.getCacheManagerConfiguration()
.serialization()
.advancedExternalizers();
for ( AdvancedExternalizer<?> ogmExternalizer : ogmExternal... | [
"public",
"static",
"void",
"validateExternalizersPresent",
"(",
"EmbeddedCacheManager",
"externalCacheManager",
")",
"{",
"Map",
"<",
"Integer",
",",
"AdvancedExternalizer",
"<",
"?",
">",
">",
"externalizerMap",
"=",
"externalCacheManager",
".",
"getCacheManagerConfigur... | Verify that all OGM custom externalizers are present.
N.B. even if some Externalizer is only needed in specific configuration,
it is not safe to start a CacheManager without one as the same CacheManager
might be used, or have been used in the past, to store data using a different
configuration.
@see ExternalizerIds
@s... | [
"Verify",
"that",
"all",
"OGM",
"custom",
"externalizers",
"are",
"present",
".",
"N",
".",
"B",
".",
"even",
"if",
"some",
"Externalizer",
"is",
"only",
"needed",
"in",
"specific",
"configuration",
"it",
"is",
"not",
"safe",
"to",
"start",
"a",
"CacheMana... | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/ExternalizersIntegration.java#L107-L128 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/map/impl/MapDatastoreProvider.java | MapDatastoreProvider.writeLock | public void writeLock(EntityKey key, int timeout) {
ReadWriteLock lock = getLock( key );
Lock writeLock = lock.writeLock();
acquireLock( key, timeout, writeLock );
} | java | public void writeLock(EntityKey key, int timeout) {
ReadWriteLock lock = getLock( key );
Lock writeLock = lock.writeLock();
acquireLock( key, timeout, writeLock );
} | [
"public",
"void",
"writeLock",
"(",
"EntityKey",
"key",
",",
"int",
"timeout",
")",
"{",
"ReadWriteLock",
"lock",
"=",
"getLock",
"(",
"key",
")",
";",
"Lock",
"writeLock",
"=",
"lock",
".",
"writeLock",
"(",
")",
";",
"acquireLock",
"(",
"key",
",",
"... | Acquires a write lock on a specific key.
@param key The key to lock
@param timeout in milliseconds; -1 means wait indefinitely, 0 means no wait. | [
"Acquires",
"a",
"write",
"lock",
"on",
"a",
"specific",
"key",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/map/impl/MapDatastoreProvider.java#L94-L98 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/map/impl/MapDatastoreProvider.java | MapDatastoreProvider.readLock | public void readLock(EntityKey key, int timeout) {
ReadWriteLock lock = getLock( key );
Lock readLock = lock.readLock();
acquireLock( key, timeout, readLock );
} | java | public void readLock(EntityKey key, int timeout) {
ReadWriteLock lock = getLock( key );
Lock readLock = lock.readLock();
acquireLock( key, timeout, readLock );
} | [
"public",
"void",
"readLock",
"(",
"EntityKey",
"key",
",",
"int",
"timeout",
")",
"{",
"ReadWriteLock",
"lock",
"=",
"getLock",
"(",
"key",
")",
";",
"Lock",
"readLock",
"=",
"lock",
".",
"readLock",
"(",
")",
";",
"acquireLock",
"(",
"key",
",",
"tim... | Acquires a read lock on a specific key.
@param key The key to lock
@param timeout in milliseconds; -1 means wait indefinitely, 0 means no wait. | [
"Acquires",
"a",
"read",
"lock",
"on",
"a",
"specific",
"key",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/map/impl/MapDatastoreProvider.java#L105-L109 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/map/impl/MapDatastoreProvider.java | MapDatastoreProvider.getAssociationsMap | public Map<AssociationKey, Map<RowKey, Map<String, Object>>> getAssociationsMap() {
return Collections.unmodifiableMap( associationsKeyValueStorage );
} | java | public Map<AssociationKey, Map<RowKey, Map<String, Object>>> getAssociationsMap() {
return Collections.unmodifiableMap( associationsKeyValueStorage );
} | [
"public",
"Map",
"<",
"AssociationKey",
",",
"Map",
"<",
"RowKey",
",",
"Map",
"<",
"String",
",",
"Object",
">",
">",
">",
"getAssociationsMap",
"(",
")",
"{",
"return",
"Collections",
".",
"unmodifiableMap",
"(",
"associationsKeyValueStorage",
")",
";",
"}... | Meant to execute assertions in tests only
@return a read-only view of the map containing the relations between entities | [
"Meant",
"to",
"execute",
"assertions",
"in",
"tests",
"only"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/map/impl/MapDatastoreProvider.java#L188-L190 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/document/impl/DotPatternMapHelpers.java | DotPatternMapHelpers.flatten | public static String flatten(String left, String right) {
return left == null || left.isEmpty() ? right : left + "." + right;
} | java | public static String flatten(String left, String right) {
return left == null || left.isEmpty() ? right : left + "." + right;
} | [
"public",
"static",
"String",
"flatten",
"(",
"String",
"left",
",",
"String",
"right",
")",
"{",
"return",
"left",
"==",
"null",
"||",
"left",
".",
"isEmpty",
"(",
")",
"?",
"right",
":",
"left",
"+",
"\".\"",
"+",
"right",
";",
"}"
] | Links the two field names into a single left.right field name.
If the left field is empty, right is returned
@param left one field name
@param right the other field name
@return left.right or right if left is an empty string | [
"Links",
"the",
"two",
"field",
"names",
"into",
"a",
"single",
"left",
".",
"right",
"field",
"name",
".",
"If",
"the",
"left",
"field",
"is",
"empty",
"right",
"is",
"returned"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/document/impl/DotPatternMapHelpers.java#L100-L102 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/document/impl/DotPatternMapHelpers.java | DotPatternMapHelpers.organizeAssociationMapByRowKey | public static boolean organizeAssociationMapByRowKey(
org.hibernate.ogm.model.spi.Association association,
AssociationKey key,
AssociationContext associationContext) {
if ( association.isEmpty() ) {
return false;
}
if ( key.getMetadata().getRowKeyIndexColumnNames().length != 1 ) {
return false;
... | java | public static boolean organizeAssociationMapByRowKey(
org.hibernate.ogm.model.spi.Association association,
AssociationKey key,
AssociationContext associationContext) {
if ( association.isEmpty() ) {
return false;
}
if ( key.getMetadata().getRowKeyIndexColumnNames().length != 1 ) {
return false;
... | [
"public",
"static",
"boolean",
"organizeAssociationMapByRowKey",
"(",
"org",
".",
"hibernate",
".",
"ogm",
".",
"model",
".",
"spi",
".",
"Association",
"association",
",",
"AssociationKey",
"key",
",",
"AssociationContext",
"associationContext",
")",
"{",
"if",
"... | Whether the rows of the given association should be stored in a hash using the single row key column as key or
not. | [
"Whether",
"the",
"rows",
"of",
"the",
"given",
"association",
"should",
"be",
"stored",
"in",
"a",
"hash",
"using",
"the",
"single",
"row",
"key",
"column",
"as",
"key",
"or",
"not",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/document/impl/DotPatternMapHelpers.java#L108-L130 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/type/impl/ManyToOneType.java | ManyToOneType.scheduleBatchLoadIfNeeded | private void scheduleBatchLoadIfNeeded(Serializable id, SharedSessionContractImplementor session) throws MappingException {
//cannot batch fetch by unique key (property-ref associations)
if ( StringHelper.isEmpty( delegate.getRHSUniqueKeyPropertyName() ) && id != null ) {
EntityPersister persister = session.getF... | java | private void scheduleBatchLoadIfNeeded(Serializable id, SharedSessionContractImplementor session) throws MappingException {
//cannot batch fetch by unique key (property-ref associations)
if ( StringHelper.isEmpty( delegate.getRHSUniqueKeyPropertyName() ) && id != null ) {
EntityPersister persister = session.getF... | [
"private",
"void",
"scheduleBatchLoadIfNeeded",
"(",
"Serializable",
"id",
",",
"SharedSessionContractImplementor",
"session",
")",
"throws",
"MappingException",
"{",
"//cannot batch fetch by unique key (property-ref associations)",
"if",
"(",
"StringHelper",
".",
"isEmpty",
"(... | Register the entity as batch loadable, if enabled
Copied from {@link org.hibernate.type.ManyToOneType#scheduleBatchLoadIfNeeded} | [
"Register",
"the",
"entity",
"as",
"batch",
"loadable",
"if",
"enabled"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/type/impl/ManyToOneType.java#L80-L89 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/type/GeoMultiPoint.java | GeoMultiPoint.addPoint | public GeoMultiPoint addPoint(GeoPoint point) {
Contracts.assertNotNull( point, "point" );
this.points.add( point );
return this;
} | java | public GeoMultiPoint addPoint(GeoPoint point) {
Contracts.assertNotNull( point, "point" );
this.points.add( point );
return this;
} | [
"public",
"GeoMultiPoint",
"addPoint",
"(",
"GeoPoint",
"point",
")",
"{",
"Contracts",
".",
"assertNotNull",
"(",
"point",
",",
"\"point\"",
")",
";",
"this",
".",
"points",
".",
"add",
"(",
"point",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new point.
@param point a point
@return this for chaining | [
"Adds",
"a",
"new",
"point",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/type/GeoMultiPoint.java#L76-L80 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/query/parsing/impl/Neo4jAliasResolver.java | Neo4jAliasResolver.findAlias | public String findAlias(String entityAlias, List<String> propertyPathWithoutAlias) {
RelationshipAliasTree aliasTree = relationshipAliases.get( entityAlias );
if ( aliasTree == null ) {
return null;
}
RelationshipAliasTree associationAlias = aliasTree;
for ( int i = 0; i < propertyPathWithoutAlias.size(); ... | java | public String findAlias(String entityAlias, List<String> propertyPathWithoutAlias) {
RelationshipAliasTree aliasTree = relationshipAliases.get( entityAlias );
if ( aliasTree == null ) {
return null;
}
RelationshipAliasTree associationAlias = aliasTree;
for ( int i = 0; i < propertyPathWithoutAlias.size(); ... | [
"public",
"String",
"findAlias",
"(",
"String",
"entityAlias",
",",
"List",
"<",
"String",
">",
"propertyPathWithoutAlias",
")",
"{",
"RelationshipAliasTree",
"aliasTree",
"=",
"relationshipAliases",
".",
"get",
"(",
"entityAlias",
")",
";",
"if",
"(",
"aliasTree"... | Given the alias of the entity and the path to the relationship it will return the alias
of the component.
@param entityAlias the alias of the entity
@param propertyPathWithoutAlias the path to the property without the alias
@return the alias the relationship or null | [
"Given",
"the",
"alias",
"of",
"the",
"entity",
"and",
"the",
"path",
"to",
"the",
"relationship",
"it",
"will",
"return",
"the",
"alias",
"of",
"the",
"component",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/query/parsing/impl/Neo4jAliasResolver.java#L130-L143 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java | EmbeddedNeo4jEntityQueries.createEmbedded | public Node createEmbedded(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
Result result = executionEngine.execute( getCreateEmbeddedNodeQuery(), params );
return singleResult( result );
} | java | public Node createEmbedded(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
Result result = executionEngine.execute( getCreateEmbeddedNodeQuery(), params );
return singleResult( result );
} | [
"public",
"Node",
"createEmbedded",
"(",
"GraphDatabaseService",
"executionEngine",
",",
"Object",
"[",
"]",
"columnValues",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
"=",
"params",
"(",
"columnValues",
")",
";",
"Result",
"result",
"=",
... | Create a single node representing an embedded element.
@param executionEngine the {@link GraphDatabaseService} used to run the query
@param columnValues the values in {@link org.hibernate.ogm.model.key.spi.EntityKey#getColumnValues()}
@return the corresponding node; | [
"Create",
"a",
"single",
"node",
"representing",
"an",
"embedded",
"element",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java#L66-L70 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java | EmbeddedNeo4jEntityQueries.findEntity | public Node findEntity(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
Result result = executionEngine.execute( getFindEntityQuery(), params );
return singleResult( result );
} | java | public Node findEntity(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
Result result = executionEngine.execute( getFindEntityQuery(), params );
return singleResult( result );
} | [
"public",
"Node",
"findEntity",
"(",
"GraphDatabaseService",
"executionEngine",
",",
"Object",
"[",
"]",
"columnValues",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
"=",
"params",
"(",
"columnValues",
")",
";",
"Result",
"result",
"=",
"exe... | Find the node corresponding to an entity.
@param executionEngine the {@link GraphDatabaseService} used to run the query
@param columnValues the values in {@link org.hibernate.ogm.model.key.spi.EntityKey#getColumnValues()}
@return the corresponding node | [
"Find",
"the",
"node",
"corresponding",
"to",
"an",
"entity",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java#L79-L83 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java | EmbeddedNeo4jEntityQueries.insertEntity | public Node insertEntity(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
Result result = executionEngine.execute( getCreateEntityQuery(), params );
return singleResult( result );
} | java | public Node insertEntity(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
Result result = executionEngine.execute( getCreateEntityQuery(), params );
return singleResult( result );
} | [
"public",
"Node",
"insertEntity",
"(",
"GraphDatabaseService",
"executionEngine",
",",
"Object",
"[",
"]",
"columnValues",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
"=",
"params",
"(",
"columnValues",
")",
";",
"Result",
"result",
"=",
"e... | Creates the node corresponding to an entity.
@param executionEngine the {@link GraphDatabaseService} used to run the query
@param columnValues the values in {@link org.hibernate.ogm.model.key.spi.EntityKey#getColumnValues()}
@return the corresponding node | [
"Creates",
"the",
"node",
"corresponding",
"to",
"an",
"entity",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java#L131-L135 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java | EmbeddedNeo4jEntityQueries.findEntities | public ResourceIterator<Node> findEntities(GraphDatabaseService executionEngine) {
Result result = executionEngine.execute( getFindEntitiesQuery() );
return result.columnAs( BaseNeo4jEntityQueries.ENTITY_ALIAS );
} | java | public ResourceIterator<Node> findEntities(GraphDatabaseService executionEngine) {
Result result = executionEngine.execute( getFindEntitiesQuery() );
return result.columnAs( BaseNeo4jEntityQueries.ENTITY_ALIAS );
} | [
"public",
"ResourceIterator",
"<",
"Node",
">",
"findEntities",
"(",
"GraphDatabaseService",
"executionEngine",
")",
"{",
"Result",
"result",
"=",
"executionEngine",
".",
"execute",
"(",
"getFindEntitiesQuery",
"(",
")",
")",
";",
"return",
"result",
".",
"columnA... | Find all the node representing the entity.
@param executionEngine the {@link GraphDatabaseService} used to run the query
@return an iterator over the nodes representing an entity | [
"Find",
"all",
"the",
"node",
"representing",
"the",
"entity",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java#L143-L146 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java | EmbeddedNeo4jEntityQueries.removeEntity | public void removeEntity(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
executionEngine.execute( getRemoveEntityQuery(), params );
} | java | public void removeEntity(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
executionEngine.execute( getRemoveEntityQuery(), params );
} | [
"public",
"void",
"removeEntity",
"(",
"GraphDatabaseService",
"executionEngine",
",",
"Object",
"[",
"]",
"columnValues",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
"=",
"params",
"(",
"columnValues",
")",
";",
"executionEngine",
".",
"exec... | Remove the nodes representing the entity and the embedded elements attached to it.
@param executionEngine the {@link GraphDatabaseService} used to run the query
@param columnValues the values of the key identifying the entity to remove | [
"Remove",
"the",
"nodes",
"representing",
"the",
"entity",
"and",
"the",
"embedded",
"elements",
"attached",
"to",
"it",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java#L154-L157 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java | EmbeddedNeo4jEntityQueries.updateEmbeddedColumn | public void updateEmbeddedColumn(GraphDatabaseService executionEngine, Object[] keyValues, String embeddedColumn, Object value) {
String query = getUpdateEmbeddedColumnQuery( keyValues, embeddedColumn );
Map<String, Object> params = params( ArrayHelper.concat( keyValues, value, value ) );
executionEngine.execute(... | java | public void updateEmbeddedColumn(GraphDatabaseService executionEngine, Object[] keyValues, String embeddedColumn, Object value) {
String query = getUpdateEmbeddedColumnQuery( keyValues, embeddedColumn );
Map<String, Object> params = params( ArrayHelper.concat( keyValues, value, value ) );
executionEngine.execute(... | [
"public",
"void",
"updateEmbeddedColumn",
"(",
"GraphDatabaseService",
"executionEngine",
",",
"Object",
"[",
"]",
"keyValues",
",",
"String",
"embeddedColumn",
",",
"Object",
"value",
")",
"{",
"String",
"query",
"=",
"getUpdateEmbeddedColumnQuery",
"(",
"keyValues",... | Update the value of an embedded node property.
@param executionEngine the {@link GraphDatabaseService} used to run the query
@param keyValues the columns representing the identifier in the entity owning the embedded
@param embeddedColumn the column on the embedded node (dot-separated properties)
@param value the new v... | [
"Update",
"the",
"value",
"of",
"an",
"embedded",
"node",
"property",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java#L167-L171 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/index/impl/MongoDBIndexSpec.java | MongoDBIndexSpec.prepareOptions | private static IndexOptions prepareOptions(MongoDBIndexType indexType, Document options, String indexName, boolean unique) {
IndexOptions indexOptions = new IndexOptions();
indexOptions.name( indexName ).unique( unique ).background( options.getBoolean( "background" , false ) );
if ( unique ) {
// MongoDB only... | java | private static IndexOptions prepareOptions(MongoDBIndexType indexType, Document options, String indexName, boolean unique) {
IndexOptions indexOptions = new IndexOptions();
indexOptions.name( indexName ).unique( unique ).background( options.getBoolean( "background" , false ) );
if ( unique ) {
// MongoDB only... | [
"private",
"static",
"IndexOptions",
"prepareOptions",
"(",
"MongoDBIndexType",
"indexType",
",",
"Document",
"options",
",",
"String",
"indexName",
",",
"boolean",
"unique",
")",
"{",
"IndexOptions",
"indexOptions",
"=",
"new",
"IndexOptions",
"(",
")",
";",
"ind... | Prepare the options by adding additional information to them.
@see <a href="https://docs.mongodb.com/manual/core/index-ttl/">TTL Indexes</a> | [
"Prepare",
"the",
"options",
"by",
"adding",
"additional",
"information",
"to",
"them",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/index/impl/MongoDBIndexSpec.java#L112-L146 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/BiDirectionalAssociationHelper.java | BiDirectionalAssociationHelper.getInverseAssociationKeyMetadata | public static AssociationKeyMetadata getInverseAssociationKeyMetadata(OgmEntityPersister mainSidePersister, int propertyIndex) {
Type propertyType = mainSidePersister.getPropertyTypes()[propertyIndex];
SessionFactoryImplementor factory = mainSidePersister.getFactory();
// property represents no association, so n... | java | public static AssociationKeyMetadata getInverseAssociationKeyMetadata(OgmEntityPersister mainSidePersister, int propertyIndex) {
Type propertyType = mainSidePersister.getPropertyTypes()[propertyIndex];
SessionFactoryImplementor factory = mainSidePersister.getFactory();
// property represents no association, so n... | [
"public",
"static",
"AssociationKeyMetadata",
"getInverseAssociationKeyMetadata",
"(",
"OgmEntityPersister",
"mainSidePersister",
",",
"int",
"propertyIndex",
")",
"{",
"Type",
"propertyType",
"=",
"mainSidePersister",
".",
"getPropertyTypes",
"(",
")",
"[",
"propertyIndex"... | Returns the meta-data for the inverse side of the association represented by the given property on the given
persister in case it represents the main side of a bi-directional one-to-many or many-to-many association.
@param mainSidePersister persister of the entity hosting the property of interest
@param propertyIndex ... | [
"Returns",
"the",
"meta",
"-",
"data",
"for",
"the",
"inverse",
"side",
"of",
"the",
"association",
"represented",
"by",
"the",
"given",
"property",
"on",
"the",
"given",
"persister",
"in",
"case",
"it",
"represents",
"the",
"main",
"side",
"of",
"a",
"bi"... | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/BiDirectionalAssociationHelper.java#L41-L89 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/BiDirectionalAssociationHelper.java | BiDirectionalAssociationHelper.getInverseCollectionPersister | public static OgmCollectionPersister getInverseCollectionPersister(OgmCollectionPersister mainSidePersister) {
if ( mainSidePersister.isInverse() || !mainSidePersister.isManyToMany() || !mainSidePersister.getElementType().isEntityType() ) {
return null;
}
EntityPersister inverseSidePersister = mainSidePersist... | java | public static OgmCollectionPersister getInverseCollectionPersister(OgmCollectionPersister mainSidePersister) {
if ( mainSidePersister.isInverse() || !mainSidePersister.isManyToMany() || !mainSidePersister.getElementType().isEntityType() ) {
return null;
}
EntityPersister inverseSidePersister = mainSidePersist... | [
"public",
"static",
"OgmCollectionPersister",
"getInverseCollectionPersister",
"(",
"OgmCollectionPersister",
"mainSidePersister",
")",
"{",
"if",
"(",
"mainSidePersister",
".",
"isInverse",
"(",
")",
"||",
"!",
"mainSidePersister",
".",
"isManyToMany",
"(",
")",
"||",
... | Returns the given collection persister for the inverse side in case the given persister represents the main side
of a bi-directional many-to-many association.
@param mainSidePersister the collection persister on the main side of a bi-directional many-to-many association
@return the collection persister for the inverse... | [
"Returns",
"the",
"given",
"collection",
"persister",
"for",
"the",
"inverse",
"side",
"in",
"case",
"the",
"given",
"persister",
"represents",
"the",
"main",
"side",
"of",
"a",
"bi",
"-",
"directional",
"many",
"-",
"to",
"-",
"many",
"association",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/BiDirectionalAssociationHelper.java#L99-L117 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/BiDirectionalAssociationHelper.java | BiDirectionalAssociationHelper.isCollectionMatching | private static boolean isCollectionMatching(Joinable mainSideJoinable, OgmCollectionPersister inverseSidePersister) {
boolean isSameTable = mainSideJoinable.getTableName().equals( inverseSidePersister.getTableName() );
if ( !isSameTable ) {
return false;
}
return Arrays.equals( mainSideJoinable.getKeyColum... | java | private static boolean isCollectionMatching(Joinable mainSideJoinable, OgmCollectionPersister inverseSidePersister) {
boolean isSameTable = mainSideJoinable.getTableName().equals( inverseSidePersister.getTableName() );
if ( !isSameTable ) {
return false;
}
return Arrays.equals( mainSideJoinable.getKeyColum... | [
"private",
"static",
"boolean",
"isCollectionMatching",
"(",
"Joinable",
"mainSideJoinable",
",",
"OgmCollectionPersister",
"inverseSidePersister",
")",
"{",
"boolean",
"isSameTable",
"=",
"mainSideJoinable",
".",
"getTableName",
"(",
")",
".",
"equals",
"(",
"inverseSi... | Checks whether table name and key column names of the given joinable and inverse collection persister match. | [
"Checks",
"whether",
"table",
"name",
"and",
"key",
"column",
"names",
"of",
"the",
"given",
"joinable",
"and",
"inverse",
"collection",
"persister",
"match",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/BiDirectionalAssociationHelper.java#L160-L168 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/dialect/impl/MongoHelpers.java | MongoHelpers.resetValue | public static void resetValue(Document entity, String column) {
// fast path for non-embedded case
if ( !column.contains( "." ) ) {
entity.remove( column );
}
else {
String[] path = DOT_SEPARATOR_PATTERN.split( column );
Object field = entity;
int size = path.length;
for ( int index = 0; index < ... | java | public static void resetValue(Document entity, String column) {
// fast path for non-embedded case
if ( !column.contains( "." ) ) {
entity.remove( column );
}
else {
String[] path = DOT_SEPARATOR_PATTERN.split( column );
Object field = entity;
int size = path.length;
for ( int index = 0; index < ... | [
"public",
"static",
"void",
"resetValue",
"(",
"Document",
"entity",
",",
"String",
"column",
")",
"{",
"// fast path for non-embedded case",
"if",
"(",
"!",
"column",
".",
"contains",
"(",
"\".\"",
")",
")",
"{",
"entity",
".",
"remove",
"(",
"column",
")",... | Remove a column from the Document
@param entity the {@link Document} with the column
@param column the column to remove | [
"Remove",
"a",
"column",
"from",
"the",
"Document"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/dialect/impl/MongoHelpers.java#L56-L79 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/impl/MongoDBSchemaDefiner.java | MongoDBSchemaDefiner.validateAsMongoDBCollectionName | private static void validateAsMongoDBCollectionName(String collectionName) {
Contracts.assertStringParameterNotEmpty( collectionName, "requestedName" );
//Yes it has some strange requirements.
if ( collectionName.startsWith( "system." ) ) {
throw log.collectionNameHasInvalidSystemPrefix( collectionName );
}
... | java | private static void validateAsMongoDBCollectionName(String collectionName) {
Contracts.assertStringParameterNotEmpty( collectionName, "requestedName" );
//Yes it has some strange requirements.
if ( collectionName.startsWith( "system." ) ) {
throw log.collectionNameHasInvalidSystemPrefix( collectionName );
}
... | [
"private",
"static",
"void",
"validateAsMongoDBCollectionName",
"(",
"String",
"collectionName",
")",
"{",
"Contracts",
".",
"assertStringParameterNotEmpty",
"(",
"collectionName",
",",
"\"requestedName\"",
")",
";",
"//Yes it has some strange requirements.",
"if",
"(",
"co... | Validates a String to be a valid name to be used in MongoDB for a collection name.
@param collectionName | [
"Validates",
"a",
"String",
"to",
"be",
"a",
"valid",
"name",
"to",
"be",
"used",
"in",
"MongoDB",
"for",
"a",
"collection",
"name",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/impl/MongoDBSchemaDefiner.java#L360-L372 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/impl/MongoDBSchemaDefiner.java | MongoDBSchemaDefiner.validateAsMongoDBFieldName | private void validateAsMongoDBFieldName(String fieldName) {
if ( fieldName.startsWith( "$" ) ) {
throw log.fieldNameHasInvalidDollarPrefix( fieldName );
}
else if ( fieldName.contains( "\u0000" ) ) {
throw log.fieldNameContainsNULCharacter( fieldName );
}
} | java | private void validateAsMongoDBFieldName(String fieldName) {
if ( fieldName.startsWith( "$" ) ) {
throw log.fieldNameHasInvalidDollarPrefix( fieldName );
}
else if ( fieldName.contains( "\u0000" ) ) {
throw log.fieldNameContainsNULCharacter( fieldName );
}
} | [
"private",
"void",
"validateAsMongoDBFieldName",
"(",
"String",
"fieldName",
")",
"{",
"if",
"(",
"fieldName",
".",
"startsWith",
"(",
"\"$\"",
")",
")",
"{",
"throw",
"log",
".",
"fieldNameHasInvalidDollarPrefix",
"(",
"fieldName",
")",
";",
"}",
"else",
"if"... | Validates a String to be a valid name to be used in MongoDB for a field name.
@param fieldName | [
"Validates",
"a",
"String",
"to",
"be",
"a",
"valid",
"name",
"to",
"be",
"used",
"in",
"MongoDB",
"for",
"a",
"field",
"name",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/impl/MongoDBSchemaDefiner.java#L379-L386 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java | OgmEntityPersister.determineBatchSize | private static int determineBatchSize(boolean canGridDialectDoMultiget, int classBatchSize, int configuredDefaultBatchSize) {
// if the dialect does not support it, don't batch so that we can avoid skewing the ORM fetch statistics
if ( !canGridDialectDoMultiget ) {
return -1;
}
else if ( classBatchSize != -1... | java | private static int determineBatchSize(boolean canGridDialectDoMultiget, int classBatchSize, int configuredDefaultBatchSize) {
// if the dialect does not support it, don't batch so that we can avoid skewing the ORM fetch statistics
if ( !canGridDialectDoMultiget ) {
return -1;
}
else if ( classBatchSize != -1... | [
"private",
"static",
"int",
"determineBatchSize",
"(",
"boolean",
"canGridDialectDoMultiget",
",",
"int",
"classBatchSize",
",",
"int",
"configuredDefaultBatchSize",
")",
"{",
"// if the dialect does not support it, don't batch so that we can avoid skewing the ORM fetch statistics",
... | Returns the effective batch size. If the dialect is multiget capable and a batch size has been configured, use
that one, otherwise the default. | [
"Returns",
"the",
"effective",
"batch",
"size",
".",
"If",
"the",
"dialect",
"is",
"multiget",
"capable",
"and",
"a",
"batch",
"size",
"has",
"been",
"configured",
"use",
"that",
"one",
"otherwise",
"the",
"default",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java#L354-L368 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java | OgmEntityPersister.getInverseOneToOneProperty | private String getInverseOneToOneProperty(String property, OgmEntityPersister otherSidePersister) {
for ( String candidate : otherSidePersister.getPropertyNames() ) {
Type candidateType = otherSidePersister.getPropertyType( candidate );
if ( candidateType.isEntityType()
&& ( ( (EntityType) candidateType ).... | java | private String getInverseOneToOneProperty(String property, OgmEntityPersister otherSidePersister) {
for ( String candidate : otherSidePersister.getPropertyNames() ) {
Type candidateType = otherSidePersister.getPropertyType( candidate );
if ( candidateType.isEntityType()
&& ( ( (EntityType) candidateType ).... | [
"private",
"String",
"getInverseOneToOneProperty",
"(",
"String",
"property",
",",
"OgmEntityPersister",
"otherSidePersister",
")",
"{",
"for",
"(",
"String",
"candidate",
":",
"otherSidePersister",
".",
"getPropertyNames",
"(",
")",
")",
"{",
"Type",
"candidateType",... | Returns the name from the inverse side if the given property de-notes a one-to-one association. | [
"Returns",
"the",
"name",
"from",
"the",
"inverse",
"side",
"if",
"the",
"given",
"property",
"de",
"-",
"notes",
"a",
"one",
"-",
"to",
"-",
"one",
"association",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java#L415-L426 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java | OgmEntityPersister.getDatabaseSnapshot | @Override
public Object[] getDatabaseSnapshot(Serializable id, SharedSessionContractImplementor session)
throws HibernateException {
if ( log.isTraceEnabled() ) {
log.trace( "Getting current persistent state for: " + MessageHelper.infoString( this, id, getFactory() ) );
}
//snapshot is a Map in the end
... | java | @Override
public Object[] getDatabaseSnapshot(Serializable id, SharedSessionContractImplementor session)
throws HibernateException {
if ( log.isTraceEnabled() ) {
log.trace( "Getting current persistent state for: " + MessageHelper.infoString( this, id, getFactory() ) );
}
//snapshot is a Map in the end
... | [
"@",
"Override",
"public",
"Object",
"[",
"]",
"getDatabaseSnapshot",
"(",
"Serializable",
"id",
",",
"SharedSessionContractImplementor",
"session",
")",
"throws",
"HibernateException",
"{",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"log",
"."... | This snapshot is meant to be used when updating data. | [
"This",
"snapshot",
"is",
"meant",
"to",
"be",
"used",
"when",
"updating",
"data",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java#L644-L669 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java | OgmEntityPersister.initializeLazyPropertiesFromCache | private Object initializeLazyPropertiesFromCache(
final String fieldName,
final Object entity,
final SharedSessionContractImplementor session,
final EntityEntry entry,
final CacheEntry cacheEntry
) {
throw new NotSupportedException( "OGM-9", "Lazy properties not supported in OGM" );
} | java | private Object initializeLazyPropertiesFromCache(
final String fieldName,
final Object entity,
final SharedSessionContractImplementor session,
final EntityEntry entry,
final CacheEntry cacheEntry
) {
throw new NotSupportedException( "OGM-9", "Lazy properties not supported in OGM" );
} | [
"private",
"Object",
"initializeLazyPropertiesFromCache",
"(",
"final",
"String",
"fieldName",
",",
"final",
"Object",
"entity",
",",
"final",
"SharedSessionContractImplementor",
"session",
",",
"final",
"EntityEntry",
"entry",
",",
"final",
"CacheEntry",
"cacheEntry",
... | Make superclasses method protected?? | [
"Make",
"superclasses",
"method",
"protected??"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java#L708-L716 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java | OgmEntityPersister.getCurrentVersion | @Override
public Object getCurrentVersion(Serializable id, SharedSessionContractImplementor session) throws HibernateException {
if ( log.isTraceEnabled() ) {
log.trace( "Getting version: " + MessageHelper.infoString( this, id, getFactory() ) );
}
final Tuple resultset = getFreshTuple( EntityKeyBuilder.fromP... | java | @Override
public Object getCurrentVersion(Serializable id, SharedSessionContractImplementor session) throws HibernateException {
if ( log.isTraceEnabled() ) {
log.trace( "Getting version: " + MessageHelper.infoString( this, id, getFactory() ) );
}
final Tuple resultset = getFreshTuple( EntityKeyBuilder.fromP... | [
"@",
"Override",
"public",
"Object",
"getCurrentVersion",
"(",
"Serializable",
"id",
",",
"SharedSessionContractImplementor",
"session",
")",
"throws",
"HibernateException",
"{",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"log",
".",
"trace",
"... | Retrieve the version number | [
"Retrieve",
"the",
"version",
"number"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java#L730-L744 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java | OgmEntityPersister.isAllOrDirtyOptLocking | private boolean isAllOrDirtyOptLocking() {
EntityMetamodel entityMetamodel = getEntityMetamodel();
return entityMetamodel.getOptimisticLockStyle() == OptimisticLockStyle.DIRTY
|| entityMetamodel.getOptimisticLockStyle() == OptimisticLockStyle.ALL;
} | java | private boolean isAllOrDirtyOptLocking() {
EntityMetamodel entityMetamodel = getEntityMetamodel();
return entityMetamodel.getOptimisticLockStyle() == OptimisticLockStyle.DIRTY
|| entityMetamodel.getOptimisticLockStyle() == OptimisticLockStyle.ALL;
} | [
"private",
"boolean",
"isAllOrDirtyOptLocking",
"(",
")",
"{",
"EntityMetamodel",
"entityMetamodel",
"=",
"getEntityMetamodel",
"(",
")",
";",
"return",
"entityMetamodel",
".",
"getOptimisticLockStyle",
"(",
")",
"==",
"OptimisticLockStyle",
".",
"DIRTY",
"||",
"entit... | Copied from AbstractEntityPersister | [
"Copied",
"from",
"AbstractEntityPersister"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java#L1296-L1300 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java | OgmEntityPersister.removeFromInverseAssociations | private void removeFromInverseAssociations(
Tuple resultset,
int tableIndex,
Serializable id,
SharedSessionContractImplementor session) {
new EntityAssociationUpdater( this )
.id( id )
.resultset( resultset )
.session( session )
.tableIndex( tableIndex )
.propertyMightRequireInverseAss... | java | private void removeFromInverseAssociations(
Tuple resultset,
int tableIndex,
Serializable id,
SharedSessionContractImplementor session) {
new EntityAssociationUpdater( this )
.id( id )
.resultset( resultset )
.session( session )
.tableIndex( tableIndex )
.propertyMightRequireInverseAss... | [
"private",
"void",
"removeFromInverseAssociations",
"(",
"Tuple",
"resultset",
",",
"int",
"tableIndex",
",",
"Serializable",
"id",
",",
"SharedSessionContractImplementor",
"session",
")",
"{",
"new",
"EntityAssociationUpdater",
"(",
"this",
")",
".",
"id",
"(",
"id... | Removes the given entity from the inverse associations it manages. | [
"Removes",
"the",
"given",
"entity",
"from",
"the",
"inverse",
"associations",
"it",
"manages",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java#L1349-L1361 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java | OgmEntityPersister.addToInverseAssociations | private void addToInverseAssociations(
Tuple resultset,
int tableIndex,
Serializable id,
SharedSessionContractImplementor session) {
new EntityAssociationUpdater( this )
.id( id )
.resultset( resultset )
.session( session )
.tableIndex( tableIndex )
.propertyMightRequireInverseAssociat... | java | private void addToInverseAssociations(
Tuple resultset,
int tableIndex,
Serializable id,
SharedSessionContractImplementor session) {
new EntityAssociationUpdater( this )
.id( id )
.resultset( resultset )
.session( session )
.tableIndex( tableIndex )
.propertyMightRequireInverseAssociat... | [
"private",
"void",
"addToInverseAssociations",
"(",
"Tuple",
"resultset",
",",
"int",
"tableIndex",
",",
"Serializable",
"id",
",",
"SharedSessionContractImplementor",
"session",
")",
"{",
"new",
"EntityAssociationUpdater",
"(",
"this",
")",
".",
"id",
"(",
"id",
... | Adds the given entity to the inverse associations it manages. | [
"Adds",
"the",
"given",
"entity",
"to",
"the",
"inverse",
"associations",
"it",
"manages",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java#L1366-L1378 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java | OgmEntityPersister.processGeneratedProperties | private void processGeneratedProperties(
Serializable id,
Object entity,
Object[] state,
SharedSessionContractImplementor session,
GenerationTiming matchTiming) {
Tuple tuple = getFreshTuple( EntityKeyBuilder.fromPersister( this, id, session ), session );
saveSharedTuple( entity, tuple, session );
... | java | private void processGeneratedProperties(
Serializable id,
Object entity,
Object[] state,
SharedSessionContractImplementor session,
GenerationTiming matchTiming) {
Tuple tuple = getFreshTuple( EntityKeyBuilder.fromPersister( this, id, session ), session );
saveSharedTuple( entity, tuple, session );
... | [
"private",
"void",
"processGeneratedProperties",
"(",
"Serializable",
"id",
",",
"Object",
"entity",
",",
"Object",
"[",
"]",
"state",
",",
"SharedSessionContractImplementor",
"session",
",",
"GenerationTiming",
"matchTiming",
")",
"{",
"Tuple",
"tuple",
"=",
"getFr... | Re-reads the given entity, refreshing any properties updated on the server-side during insert or update. | [
"Re",
"-",
"reads",
"the",
"given",
"entity",
"refreshing",
"any",
"properties",
"updated",
"on",
"the",
"server",
"-",
"side",
"during",
"insert",
"or",
"update",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java#L1873-L1897 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java | OgmEntityPersister.isReadRequired | private boolean isReadRequired(ValueGeneration valueGeneration, GenerationTiming matchTiming) {
return valueGeneration != null && valueGeneration.getValueGenerator() == null &&
timingsMatch( valueGeneration.getGenerationTiming(), matchTiming );
} | java | private boolean isReadRequired(ValueGeneration valueGeneration, GenerationTiming matchTiming) {
return valueGeneration != null && valueGeneration.getValueGenerator() == null &&
timingsMatch( valueGeneration.getGenerationTiming(), matchTiming );
} | [
"private",
"boolean",
"isReadRequired",
"(",
"ValueGeneration",
"valueGeneration",
",",
"GenerationTiming",
"matchTiming",
")",
"{",
"return",
"valueGeneration",
"!=",
"null",
"&&",
"valueGeneration",
".",
"getValueGenerator",
"(",
")",
"==",
"null",
"&&",
"timingsMat... | Whether the given value generation strategy requires to read the value from the database or not. | [
"Whether",
"the",
"given",
"value",
"generation",
"strategy",
"requires",
"to",
"read",
"the",
"value",
"from",
"the",
"database",
"or",
"not",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java#L1902-L1905 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/CustomLoaderHelper.java | CustomLoaderHelper.listOfEntities | public static List<Object> listOfEntities(SharedSessionContractImplementor session, Type[] resultTypes, ClosableIterator<Tuple> tuples) {
Class<?> returnedClass = resultTypes[0].getReturnedClass();
TupleBasedEntityLoader loader = getLoader( session, returnedClass );
OgmLoadingContext ogmLoadingContext = new OgmLo... | java | public static List<Object> listOfEntities(SharedSessionContractImplementor session, Type[] resultTypes, ClosableIterator<Tuple> tuples) {
Class<?> returnedClass = resultTypes[0].getReturnedClass();
TupleBasedEntityLoader loader = getLoader( session, returnedClass );
OgmLoadingContext ogmLoadingContext = new OgmLo... | [
"public",
"static",
"List",
"<",
"Object",
">",
"listOfEntities",
"(",
"SharedSessionContractImplementor",
"session",
",",
"Type",
"[",
"]",
"resultTypes",
",",
"ClosableIterator",
"<",
"Tuple",
">",
"tuples",
")",
"{",
"Class",
"<",
"?",
">",
"returnedClass",
... | At the moment we only support the case where one entity type is returned | [
"At",
"the",
"moment",
"we",
"only",
"support",
"the",
"case",
"where",
"one",
"entity",
"type",
"is",
"returned"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/CustomLoaderHelper.java#L29-L35 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/massindex/impl/BatchCoordinator.java | BatchCoordinator.doBatchWork | private void doBatchWork(BatchBackend backend) throws InterruptedException {
ExecutorService executor = Executors.newFixedThreadPool( typesToIndexInParallel, "BatchIndexingWorkspace" );
for ( IndexedTypeIdentifier indexedTypeIdentifier : rootIndexedTypes ) {
executor.execute( new BatchIndexingWorkspace( gridDial... | java | private void doBatchWork(BatchBackend backend) throws InterruptedException {
ExecutorService executor = Executors.newFixedThreadPool( typesToIndexInParallel, "BatchIndexingWorkspace" );
for ( IndexedTypeIdentifier indexedTypeIdentifier : rootIndexedTypes ) {
executor.execute( new BatchIndexingWorkspace( gridDial... | [
"private",
"void",
"doBatchWork",
"(",
"BatchBackend",
"backend",
")",
"throws",
"InterruptedException",
"{",
"ExecutorService",
"executor",
"=",
"Executors",
".",
"newFixedThreadPool",
"(",
"typesToIndexInParallel",
",",
"\"BatchIndexingWorkspace\"",
")",
";",
"for",
"... | Will spawn a thread for each type in rootEntities, they will all re-join
on endAllSignal when finished.
@param backend
@throws InterruptedException
if interrupted while waiting for endAllSignal. | [
"Will",
"spawn",
"a",
"thread",
"for",
"each",
"type",
"in",
"rootEntities",
"they",
"will",
"all",
"re",
"-",
"join",
"on",
"endAllSignal",
"when",
"finished",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/massindex/impl/BatchCoordinator.java#L105-L113 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/massindex/impl/BatchCoordinator.java | BatchCoordinator.afterBatch | private void afterBatch(BatchBackend backend) {
IndexedTypeSet targetedTypes = searchFactoryImplementor.getIndexedTypesPolymorphic( rootIndexedTypes );
if ( this.optimizeAtEnd ) {
backend.optimize( targetedTypes );
}
backend.flush( targetedTypes );
} | java | private void afterBatch(BatchBackend backend) {
IndexedTypeSet targetedTypes = searchFactoryImplementor.getIndexedTypesPolymorphic( rootIndexedTypes );
if ( this.optimizeAtEnd ) {
backend.optimize( targetedTypes );
}
backend.flush( targetedTypes );
} | [
"private",
"void",
"afterBatch",
"(",
"BatchBackend",
"backend",
")",
"{",
"IndexedTypeSet",
"targetedTypes",
"=",
"searchFactoryImplementor",
".",
"getIndexedTypesPolymorphic",
"(",
"rootIndexedTypes",
")",
";",
"if",
"(",
"this",
".",
"optimizeAtEnd",
")",
"{",
"b... | Operations to do after all subthreads finished their work on index
@param backend | [
"Operations",
"to",
"do",
"after",
"all",
"subthreads",
"finished",
"their",
"work",
"on",
"index"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/massindex/impl/BatchCoordinator.java#L120-L126 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/massindex/impl/BatchCoordinator.java | BatchCoordinator.beforeBatch | private void beforeBatch(BatchBackend backend) {
if ( this.purgeAtStart ) {
// purgeAll for affected entities
IndexedTypeSet targetedTypes = searchFactoryImplementor.getIndexedTypesPolymorphic( rootIndexedTypes );
for ( IndexedTypeIdentifier type : targetedTypes ) {
// needs do be in-sync work to make su... | java | private void beforeBatch(BatchBackend backend) {
if ( this.purgeAtStart ) {
// purgeAll for affected entities
IndexedTypeSet targetedTypes = searchFactoryImplementor.getIndexedTypesPolymorphic( rootIndexedTypes );
for ( IndexedTypeIdentifier type : targetedTypes ) {
// needs do be in-sync work to make su... | [
"private",
"void",
"beforeBatch",
"(",
"BatchBackend",
"backend",
")",
"{",
"if",
"(",
"this",
".",
"purgeAtStart",
")",
"{",
"// purgeAll for affected entities",
"IndexedTypeSet",
"targetedTypes",
"=",
"searchFactoryImplementor",
".",
"getIndexedTypesPolymorphic",
"(",
... | Optional operations to do before the multiple-threads start indexing
@param backend | [
"Optional",
"operations",
"to",
"do",
"before",
"the",
"multiple",
"-",
"threads",
"start",
"indexing"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/massindex/impl/BatchCoordinator.java#L133-L145 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/CollectionHelper.java | CollectionHelper.asSet | @SafeVarargs
public static <T> Set<T> asSet(T... ts) {
if ( ts == null ) {
return null;
}
else if ( ts.length == 0 ) {
return Collections.emptySet();
}
else {
Set<T> set = new HashSet<T>( getInitialCapacityFromExpectedSize( ts.length ) );
Collections.addAll( set, ts );
return Collections.unmod... | java | @SafeVarargs
public static <T> Set<T> asSet(T... ts) {
if ( ts == null ) {
return null;
}
else if ( ts.length == 0 ) {
return Collections.emptySet();
}
else {
Set<T> set = new HashSet<T>( getInitialCapacityFromExpectedSize( ts.length ) );
Collections.addAll( set, ts );
return Collections.unmod... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"Set",
"<",
"T",
">",
"asSet",
"(",
"T",
"...",
"ts",
")",
"{",
"if",
"(",
"ts",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"ts",
".",
"length",
"==",
"0",
")"... | Returns an unmodifiable set containing the given elements.
@param ts the elements from which to create a set
@param <T> the type of the element in the set
@return an unmodifiable set containing the given elements or {@code null} in case the given element array is
{@code null}. | [
"Returns",
"an",
"unmodifiable",
"set",
"containing",
"the",
"given",
"elements",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/CollectionHelper.java#L46-L59 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/type/impl/EnumType.java | EnumType.isOrdinal | private boolean isOrdinal(int paramType) {
switch ( paramType ) {
case Types.INTEGER:
case Types.NUMERIC:
case Types.SMALLINT:
case Types.TINYINT:
case Types.BIGINT:
case Types.DECIMAL: //for Oracle Driver
case Types.DOUBLE: //for Oracle Driver
case Types.FLOAT: //for Oracle Driver
retu... | java | private boolean isOrdinal(int paramType) {
switch ( paramType ) {
case Types.INTEGER:
case Types.NUMERIC:
case Types.SMALLINT:
case Types.TINYINT:
case Types.BIGINT:
case Types.DECIMAL: //for Oracle Driver
case Types.DOUBLE: //for Oracle Driver
case Types.FLOAT: //for Oracle Driver
retu... | [
"private",
"boolean",
"isOrdinal",
"(",
"int",
"paramType",
")",
"{",
"switch",
"(",
"paramType",
")",
"{",
"case",
"Types",
".",
"INTEGER",
":",
"case",
"Types",
".",
"NUMERIC",
":",
"case",
"Types",
".",
"SMALLINT",
":",
"case",
"Types",
".",
"TINYINT"... | in truth we probably only need the types as injected by the metadata binder | [
"in",
"truth",
"we",
"probably",
"only",
"need",
"the",
"types",
"as",
"injected",
"by",
"the",
"metadata",
"binder"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/type/impl/EnumType.java#L143-L161 | train |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/impl/InfinispanEmbeddedStoredProceduresManager.java | InfinispanEmbeddedStoredProceduresManager.callStoredProcedure | public ClosableIterator<Tuple> callStoredProcedure(EmbeddedCacheManager embeddedCacheManager, String storedProcedureName, ProcedureQueryParameters queryParameters, ClassLoaderService classLoaderService ) {
validate( queryParameters );
Cache<String, String> cache = embeddedCacheManager.getCache( STORED_PROCEDURES_CA... | java | public ClosableIterator<Tuple> callStoredProcedure(EmbeddedCacheManager embeddedCacheManager, String storedProcedureName, ProcedureQueryParameters queryParameters, ClassLoaderService classLoaderService ) {
validate( queryParameters );
Cache<String, String> cache = embeddedCacheManager.getCache( STORED_PROCEDURES_CA... | [
"public",
"ClosableIterator",
"<",
"Tuple",
">",
"callStoredProcedure",
"(",
"EmbeddedCacheManager",
"embeddedCacheManager",
",",
"String",
"storedProcedureName",
",",
"ProcedureQueryParameters",
"queryParameters",
",",
"ClassLoaderService",
"classLoaderService",
")",
"{",
"v... | Returns the result of a stored procedure executed on the backend.
@param embeddedCacheManager embedded cache manager
@param storedProcedureName name of stored procedure
@param queryParameters parameters passed for this query
@param classLoaderService the class loader service
@return a {@link ClosableIterator} with th... | [
"Returns",
"the",
"result",
"of",
"a",
"stored",
"procedure",
"executed",
"on",
"the",
"backend",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/impl/InfinispanEmbeddedStoredProceduresManager.java#L51-L59 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/document/association/impl/DocumentHelpers.java | DocumentHelpers.getPrefix | public static String getPrefix(String column) {
return column.contains( "." ) ? DOT_SEPARATOR_PATTERN.split( column )[0] : null;
} | java | public static String getPrefix(String column) {
return column.contains( "." ) ? DOT_SEPARATOR_PATTERN.split( column )[0] : null;
} | [
"public",
"static",
"String",
"getPrefix",
"(",
"String",
"column",
")",
"{",
"return",
"column",
".",
"contains",
"(",
"\".\"",
")",
"?",
"DOT_SEPARATOR_PATTERN",
".",
"split",
"(",
"column",
")",
"[",
"0",
"]",
":",
"null",
";",
"}"
] | If the column name is a dotted column, returns the first part.
Returns null otherwise.
@param column the column that might have a prefix
@return the first part of the prefix of the column or {@code null} if the column does not have a prefix. | [
"If",
"the",
"column",
"name",
"is",
"a",
"dotted",
"column",
"returns",
"the",
"first",
"part",
".",
"Returns",
"null",
"otherwise",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/document/association/impl/DocumentHelpers.java#L26-L28 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/document/association/impl/DocumentHelpers.java | DocumentHelpers.getColumnSharedPrefix | public static String getColumnSharedPrefix(String[] associationKeyColumns) {
String prefix = null;
for ( String column : associationKeyColumns ) {
String newPrefix = getPrefix( column );
if ( prefix == null ) { // first iteration
prefix = newPrefix;
if ( prefix == null ) { // no prefix, quit
brea... | java | public static String getColumnSharedPrefix(String[] associationKeyColumns) {
String prefix = null;
for ( String column : associationKeyColumns ) {
String newPrefix = getPrefix( column );
if ( prefix == null ) { // first iteration
prefix = newPrefix;
if ( prefix == null ) { // no prefix, quit
brea... | [
"public",
"static",
"String",
"getColumnSharedPrefix",
"(",
"String",
"[",
"]",
"associationKeyColumns",
")",
"{",
"String",
"prefix",
"=",
"null",
";",
"for",
"(",
"String",
"column",
":",
"associationKeyColumns",
")",
"{",
"String",
"newPrefix",
"=",
"getPrefi... | Returns the shared prefix of these columns. Null otherwise.
@param associationKeyColumns the columns sharing a prefix
@return the shared prefix of these columns. {@code null} otherwise. | [
"Returns",
"the",
"shared",
"prefix",
"of",
"these",
"columns",
".",
"Null",
"otherwise",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/document/association/impl/DocumentHelpers.java#L36-L54 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/massindex/impl/Executors.java | Executors.newFixedThreadPool | public static ThreadPoolExecutor newFixedThreadPool(int threads, String groupname, int queueSize) {
return new ThreadPoolExecutor( threads, threads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(
queueSize ), new SearchThreadFactory( groupname ), new BlockPolicy() );
} | java | public static ThreadPoolExecutor newFixedThreadPool(int threads, String groupname, int queueSize) {
return new ThreadPoolExecutor( threads, threads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(
queueSize ), new SearchThreadFactory( groupname ), new BlockPolicy() );
} | [
"public",
"static",
"ThreadPoolExecutor",
"newFixedThreadPool",
"(",
"int",
"threads",
",",
"String",
"groupname",
",",
"int",
"queueSize",
")",
"{",
"return",
"new",
"ThreadPoolExecutor",
"(",
"threads",
",",
"threads",
",",
"0L",
",",
"TimeUnit",
".",
"MILLISE... | Creates a new fixed size ThreadPoolExecutor
@param threads
the number of threads
@param groupname
a label to identify the threadpool; useful for profiling.
@param queueSize
the size of the queue to store Runnables when all threads are busy
@return the new ExecutorService | [
"Creates",
"a",
"new",
"fixed",
"size",
"ThreadPoolExecutor"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/massindex/impl/Executors.java#L61-L64 | train |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/common/externalizer/impl/VersionChecker.java | VersionChecker.readAndCheckVersion | public static void readAndCheckVersion(ObjectInput input, int supportedVersion, Class<?> externalizedType) throws IOException {
int version = input.readInt();
if ( version != supportedVersion ) {
throw LOG.unexpectedKeyVersion( externalizedType, version, supportedVersion );
}
} | java | public static void readAndCheckVersion(ObjectInput input, int supportedVersion, Class<?> externalizedType) throws IOException {
int version = input.readInt();
if ( version != supportedVersion ) {
throw LOG.unexpectedKeyVersion( externalizedType, version, supportedVersion );
}
} | [
"public",
"static",
"void",
"readAndCheckVersion",
"(",
"ObjectInput",
"input",
",",
"int",
"supportedVersion",
",",
"Class",
"<",
"?",
">",
"externalizedType",
")",
"throws",
"IOException",
"{",
"int",
"version",
"=",
"input",
".",
"readInt",
"(",
")",
";",
... | Consumes the version field from the given input and raises an exception if the record is in a newer version,
written by a newer version of Hibernate OGM.
@param input the input to read from
@param supportedVersion the type version supported by this version of OGM
@param externalizedType the type to be unmarshalled
@t... | [
"Consumes",
"the",
"version",
"field",
"from",
"the",
"given",
"input",
"and",
"raises",
"an",
"exception",
"if",
"the",
"record",
"is",
"in",
"a",
"newer",
"version",
"written",
"by",
"a",
"newer",
"version",
"of",
"Hibernate",
"OGM",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/common/externalizer/impl/VersionChecker.java#L35-L41 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/common/util/impl/RemoteNeo4jHelper.java | RemoteNeo4jHelper.matches | public static boolean matches(Map<String, Object> nodeProperties, String[] keyColumnNames, Object[] keyColumnValues) {
for ( int i = 0; i < keyColumnNames.length; i++ ) {
String property = keyColumnNames[i];
Object expectedValue = keyColumnValues[i];
boolean containsProperty = nodeProperties.containsKey( pro... | java | public static boolean matches(Map<String, Object> nodeProperties, String[] keyColumnNames, Object[] keyColumnValues) {
for ( int i = 0; i < keyColumnNames.length; i++ ) {
String property = keyColumnNames[i];
Object expectedValue = keyColumnValues[i];
boolean containsProperty = nodeProperties.containsKey( pro... | [
"public",
"static",
"boolean",
"matches",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"nodeProperties",
",",
"String",
"[",
"]",
"keyColumnNames",
",",
"Object",
"[",
"]",
"keyColumnValues",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",... | Check if the node matches the column values
@param nodeProperties the properties on the node
@param keyColumnNames the name of the columns to check
@param keyColumnValues the value of the columns to check
@return true if the properties of the node match the column names and values | [
"Check",
"if",
"the",
"node",
"matches",
"the",
"column",
"values"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/common/util/impl/RemoteNeo4jHelper.java#L29-L45 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/type/GeoPolygon.java | GeoPolygon.addHoles | public GeoPolygon addHoles(List<List<GeoPoint>> holes) {
Contracts.assertNotNull( holes, "holes" );
this.rings.addAll( holes );
return this;
} | java | public GeoPolygon addHoles(List<List<GeoPoint>> holes) {
Contracts.assertNotNull( holes, "holes" );
this.rings.addAll( holes );
return this;
} | [
"public",
"GeoPolygon",
"addHoles",
"(",
"List",
"<",
"List",
"<",
"GeoPoint",
">",
">",
"holes",
")",
"{",
"Contracts",
".",
"assertNotNull",
"(",
"holes",
",",
"\"holes\"",
")",
";",
"this",
".",
"rings",
".",
"addAll",
"(",
"holes",
")",
";",
"retur... | Adds new holes to the polygon.
@param holes holes, must be contained in the exterior ring and must not overlap or
intersect another hole
@return this for chaining | [
"Adds",
"new",
"holes",
"to",
"the",
"polygon",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/type/GeoPolygon.java#L117-L121 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/options/container/impl/OptionsContainerBuilder.java | OptionsContainerBuilder.addAll | public void addAll(OptionsContainerBuilder container) {
for ( Entry<Class<? extends Option<?, ?>>, ValueContainerBuilder<?, ?>> entry : container.optionValues.entrySet() ) {
addAll( entry.getKey(), entry.getValue().build() );
}
} | java | public void addAll(OptionsContainerBuilder container) {
for ( Entry<Class<? extends Option<?, ?>>, ValueContainerBuilder<?, ?>> entry : container.optionValues.entrySet() ) {
addAll( entry.getKey(), entry.getValue().build() );
}
} | [
"public",
"void",
"addAll",
"(",
"OptionsContainerBuilder",
"container",
")",
"{",
"for",
"(",
"Entry",
"<",
"Class",
"<",
"?",
"extends",
"Option",
"<",
"?",
",",
"?",
">",
">",
",",
"ValueContainerBuilder",
"<",
"?",
",",
"?",
">",
">",
"entry",
":",... | Adds all options from the passed container to this container.
@param container a container with options to add | [
"Adds",
"all",
"options",
"from",
"the",
"passed",
"container",
"to",
"this",
"container",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/options/container/impl/OptionsContainerBuilder.java#L59-L63 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/massindex/impl/OgmMassIndexer.java | OgmMassIndexer.toRootEntities | private static IndexedTypeSet toRootEntities(ExtendedSearchIntegrator extendedIntegrator, Class<?>... selection) {
Set<Class<?>> entities = new HashSet<Class<?>>();
//first build the "entities" set containing all indexed subtypes of "selection".
for ( Class<?> entityType : selection ) {
IndexedTypeSet targeted... | java | private static IndexedTypeSet toRootEntities(ExtendedSearchIntegrator extendedIntegrator, Class<?>... selection) {
Set<Class<?>> entities = new HashSet<Class<?>>();
//first build the "entities" set containing all indexed subtypes of "selection".
for ( Class<?> entityType : selection ) {
IndexedTypeSet targeted... | [
"private",
"static",
"IndexedTypeSet",
"toRootEntities",
"(",
"ExtendedSearchIntegrator",
"extendedIntegrator",
",",
"Class",
"<",
"?",
">",
"...",
"selection",
")",
"{",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"entities",
"=",
"new",
"HashSet",
"<",
"Class",... | From the set of classes a new set is built containing all indexed
subclasses, but removing then all subtypes of indexed entities.
@param selection
@return a new set of entities | [
"From",
"the",
"set",
"of",
"classes",
"a",
"new",
"set",
"is",
"built",
"containing",
"all",
"indexed",
"subclasses",
"but",
"removing",
"then",
"all",
"subtypes",
"of",
"indexed",
"entities",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/massindex/impl/OgmMassIndexer.java#L181-L213 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/AssociationPersister.java | AssociationPersister.updateHostingEntityIfRequired | private void updateHostingEntityIfRequired() {
if ( hostingEntity != null && hostingEntityRequiresReadAfterUpdate() ) {
OgmEntityPersister entityPersister = getHostingEntityPersister();
if ( GridDialects.hasFacet( gridDialect, GroupingByEntityDialect.class ) ) {
( (GroupingByEntityDialect) gridDialect ).fl... | java | private void updateHostingEntityIfRequired() {
if ( hostingEntity != null && hostingEntityRequiresReadAfterUpdate() ) {
OgmEntityPersister entityPersister = getHostingEntityPersister();
if ( GridDialects.hasFacet( gridDialect, GroupingByEntityDialect.class ) ) {
( (GroupingByEntityDialect) gridDialect ).fl... | [
"private",
"void",
"updateHostingEntityIfRequired",
"(",
")",
"{",
"if",
"(",
"hostingEntity",
"!=",
"null",
"&&",
"hostingEntityRequiresReadAfterUpdate",
"(",
")",
")",
"{",
"OgmEntityPersister",
"entityPersister",
"=",
"getHostingEntityPersister",
"(",
")",
";",
"if... | Reads the entity hosting the association from the datastore and applies any property changes from the server
side. | [
"Reads",
"the",
"entity",
"hosting",
"the",
"association",
"from",
"the",
"datastore",
"and",
"applies",
"any",
"property",
"changes",
"from",
"the",
"server",
"side",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/AssociationPersister.java#L249-L265 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/options/navigation/impl/OptionsContextImpl.java | OptionsContextImpl.getClassHierarchy | private static List<Class<?>> getClassHierarchy(Class<?> clazz) {
List<Class<?>> hierarchy = new ArrayList<Class<?>>( 4 );
for ( Class<?> current = clazz; current != null; current = current.getSuperclass() ) {
hierarchy.add( current );
}
return hierarchy;
} | java | private static List<Class<?>> getClassHierarchy(Class<?> clazz) {
List<Class<?>> hierarchy = new ArrayList<Class<?>>( 4 );
for ( Class<?> current = clazz; current != null; current = current.getSuperclass() ) {
hierarchy.add( current );
}
return hierarchy;
} | [
"private",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"getClassHierarchy",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"hierarchy",
"=",
"new",
"ArrayList",
"<",
"Class",
"<",
"?",
">",
">",
... | Returns the class hierarchy of the given type, from bottom to top, starting with the given class itself.
Interfaces are not included.
@param clazz the class of interest
@return the class hierarchy of the given class | [
"Returns",
"the",
"class",
"hierarchy",
"of",
"the",
"given",
"type",
"from",
"bottom",
"to",
"top",
"starting",
"with",
"the",
"given",
"class",
"itself",
".",
"Interfaces",
"are",
"not",
"included",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/options/navigation/impl/OptionsContextImpl.java#L153-L161 | train |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/PersistenceStrategy.java | PersistenceStrategy.getInstance | public static PersistenceStrategy<?, ?, ?> getInstance(
CacheMappingType cacheMapping,
EmbeddedCacheManager externalCacheManager,
URL configurationUrl,
JtaPlatform jtaPlatform,
Set<EntityKeyMetadata> entityTypes,
Set<AssociationKeyMetadata> associationTypes,
Set<IdSourceKeyMetadata> idSourceTypes )... | java | public static PersistenceStrategy<?, ?, ?> getInstance(
CacheMappingType cacheMapping,
EmbeddedCacheManager externalCacheManager,
URL configurationUrl,
JtaPlatform jtaPlatform,
Set<EntityKeyMetadata> entityTypes,
Set<AssociationKeyMetadata> associationTypes,
Set<IdSourceKeyMetadata> idSourceTypes )... | [
"public",
"static",
"PersistenceStrategy",
"<",
"?",
",",
"?",
",",
"?",
">",
"getInstance",
"(",
"CacheMappingType",
"cacheMapping",
",",
"EmbeddedCacheManager",
"externalCacheManager",
",",
"URL",
"configurationUrl",
",",
"JtaPlatform",
"jtaPlatform",
",",
"Set",
... | Returns a persistence strategy based on the passed configuration.
@param cacheMapping the selected {@link org.hibernate.ogm.datastore.keyvalue.options.CacheMappingType}
@param externalCacheManager the infinispan cache manager
@param configurationUrl the location of the configuration file
@param jtaPlatform the {@link ... | [
"Returns",
"a",
"persistence",
"strategy",
"based",
"on",
"the",
"passed",
"configuration",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/PersistenceStrategy.java#L61-L87 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/service/impl/DefaultSchemaInitializationContext.java | DefaultSchemaInitializationContext.getPersistentGenerators | private Iterable<PersistentNoSqlIdentifierGenerator> getPersistentGenerators() {
Map<String, EntityPersister> entityPersisters = factory.getMetamodel().entityPersisters();
Set<PersistentNoSqlIdentifierGenerator> persistentGenerators = new HashSet<PersistentNoSqlIdentifierGenerator>( entityPersisters.size() );
fo... | java | private Iterable<PersistentNoSqlIdentifierGenerator> getPersistentGenerators() {
Map<String, EntityPersister> entityPersisters = factory.getMetamodel().entityPersisters();
Set<PersistentNoSqlIdentifierGenerator> persistentGenerators = new HashSet<PersistentNoSqlIdentifierGenerator>( entityPersisters.size() );
fo... | [
"private",
"Iterable",
"<",
"PersistentNoSqlIdentifierGenerator",
">",
"getPersistentGenerators",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"EntityPersister",
">",
"entityPersisters",
"=",
"factory",
".",
"getMetamodel",
"(",
")",
".",
"entityPersisters",
"(",
")",
... | Returns all the persistent id generators which potentially require the creation of an object in the schema. | [
"Returns",
"all",
"the",
"persistent",
"id",
"generators",
"which",
"potentially",
"require",
"the",
"creation",
"of",
"an",
"object",
"in",
"the",
"schema",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/service/impl/DefaultSchemaInitializationContext.java#L105-L116 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jAssociationQueries.java | EmbeddedNeo4jAssociationQueries.createRelationshipForEmbeddedAssociation | public Relationship createRelationshipForEmbeddedAssociation(GraphDatabaseService executionEngine, AssociationKey associationKey, EntityKey embeddedKey) {
String query = initCreateEmbeddedAssociationQuery( associationKey, embeddedKey );
Object[] queryValues = createRelationshipForEmbeddedQueryValues( associationKey... | java | public Relationship createRelationshipForEmbeddedAssociation(GraphDatabaseService executionEngine, AssociationKey associationKey, EntityKey embeddedKey) {
String query = initCreateEmbeddedAssociationQuery( associationKey, embeddedKey );
Object[] queryValues = createRelationshipForEmbeddedQueryValues( associationKey... | [
"public",
"Relationship",
"createRelationshipForEmbeddedAssociation",
"(",
"GraphDatabaseService",
"executionEngine",
",",
"AssociationKey",
"associationKey",
",",
"EntityKey",
"embeddedKey",
")",
"{",
"String",
"query",
"=",
"initCreateEmbeddedAssociationQuery",
"(",
"associat... | Give an embedded association, creates all the nodes and relationships required to represent it.
It assumes that the entity node containing the association already exists in the db.
@param executionEngine the {@link GraphDatabaseService} to run the query
@param associationKey the {@link AssociationKey} identifying the ... | [
"Give",
"an",
"embedded",
"association",
"creates",
"all",
"the",
"nodes",
"and",
"relationships",
"required",
"to",
"represent",
"it",
".",
"It",
"assumes",
"that",
"the",
"entity",
"node",
"containing",
"the",
"association",
"already",
"exists",
"in",
"the",
... | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jAssociationQueries.java#L136-L140 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmCollectionPersister.java | OgmCollectionPersister.createAndPutAssociationRowForInsert | private RowKeyAndTuple createAndPutAssociationRowForInsert(Serializable key, PersistentCollection collection,
AssociationPersister associationPersister, SharedSessionContractImplementor session, int i, Object entry) {
RowKeyBuilder rowKeyBuilder = initializeRowKeyBuilder();
Tuple associationRow = new Tuple();
... | java | private RowKeyAndTuple createAndPutAssociationRowForInsert(Serializable key, PersistentCollection collection,
AssociationPersister associationPersister, SharedSessionContractImplementor session, int i, Object entry) {
RowKeyBuilder rowKeyBuilder = initializeRowKeyBuilder();
Tuple associationRow = new Tuple();
... | [
"private",
"RowKeyAndTuple",
"createAndPutAssociationRowForInsert",
"(",
"Serializable",
"key",
",",
"PersistentCollection",
"collection",
",",
"AssociationPersister",
"associationPersister",
",",
"SharedSessionContractImplementor",
"session",
",",
"int",
"i",
",",
"Object",
... | Creates an association row representing the given entry and adds it to the association managed by the given
persister. | [
"Creates",
"an",
"association",
"row",
"representing",
"the",
"given",
"entry",
"and",
"adds",
"it",
"to",
"the",
"association",
"managed",
"by",
"the",
"given",
"persister",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmCollectionPersister.java#L384-L414 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmCollectionPersister.java | OgmCollectionPersister.doProcessQueuedOps | @Override
protected void doProcessQueuedOps(PersistentCollection collection, Serializable key, int nextIndex, SharedSessionContractImplementor session)
throws HibernateException {
// nothing to do
} | java | @Override
protected void doProcessQueuedOps(PersistentCollection collection, Serializable key, int nextIndex, SharedSessionContractImplementor session)
throws HibernateException {
// nothing to do
} | [
"@",
"Override",
"protected",
"void",
"doProcessQueuedOps",
"(",
"PersistentCollection",
"collection",
",",
"Serializable",
"key",
",",
"int",
"nextIndex",
",",
"SharedSessionContractImplementor",
"session",
")",
"throws",
"HibernateException",
"{",
"// nothing to do",
"}... | once we're on ORM 5 | [
"once",
"we",
"re",
"on",
"ORM",
"5"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmCollectionPersister.java#L834-L838 | train |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/query/parsing/impl/Neo4jPropertyHelper.java | Neo4jPropertyHelper.isIdProperty | public boolean isIdProperty(OgmEntityPersister persister, List<String> namesWithoutAlias) {
String join = StringHelper.join( namesWithoutAlias, "." );
Type propertyType = persister.getPropertyType( namesWithoutAlias.get( 0 ) );
String[] identifierColumnNames = persister.getIdentifierColumnNames();
if ( property... | java | public boolean isIdProperty(OgmEntityPersister persister, List<String> namesWithoutAlias) {
String join = StringHelper.join( namesWithoutAlias, "." );
Type propertyType = persister.getPropertyType( namesWithoutAlias.get( 0 ) );
String[] identifierColumnNames = persister.getIdentifierColumnNames();
if ( property... | [
"public",
"boolean",
"isIdProperty",
"(",
"OgmEntityPersister",
"persister",
",",
"List",
"<",
"String",
">",
"namesWithoutAlias",
")",
"{",
"String",
"join",
"=",
"StringHelper",
".",
"join",
"(",
"namesWithoutAlias",
",",
"\".\"",
")",
";",
"Type",
"propertyTy... | Check if the property is part of the identifier of the entity.
@param persister the {@link OgmEntityPersister} of the entity with the property
@param namesWithoutAlias the path to the property with all the aliases resolved
@return {@code true} if the property is part of the id, {@code false} otherwise. | [
"Check",
"if",
"the",
"property",
"is",
"part",
"of",
"the",
"identifier",
"of",
"the",
"entity",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/query/parsing/impl/Neo4jPropertyHelper.java#L164-L178 | train |
hibernate/hibernate-ogm | infinispan-remote/src/main/java/org/hibernate/ogm/datastore/infinispanremote/impl/protobuf/schema/SchemaDefinitions.java | SchemaDefinitions.deploySchema | public void deploySchema(String generatedProtobufName, RemoteCache<String, String> protobufCache, SchemaCapture schemaCapture, SchemaOverride schemaOverrideService,
URL schemaOverrideResource) {
// user defined schema
if ( schemaOverrideService != null || schemaOverrideResource != null ) {
cachedSchema = new ... | java | public void deploySchema(String generatedProtobufName, RemoteCache<String, String> protobufCache, SchemaCapture schemaCapture, SchemaOverride schemaOverrideService,
URL schemaOverrideResource) {
// user defined schema
if ( schemaOverrideService != null || schemaOverrideResource != null ) {
cachedSchema = new ... | [
"public",
"void",
"deploySchema",
"(",
"String",
"generatedProtobufName",
",",
"RemoteCache",
"<",
"String",
",",
"String",
">",
"protobufCache",
",",
"SchemaCapture",
"schemaCapture",
",",
"SchemaOverride",
"schemaOverrideService",
",",
"URL",
"schemaOverrideResource",
... | Typically this is transparently handled by using the Protostream codecs but be aware of it when bypassing Protostream. | [
"Typically",
"this",
"is",
"transparently",
"handled",
"by",
"using",
"the",
"Protostream",
"codecs",
"but",
"be",
"aware",
"of",
"it",
"when",
"bypassing",
"Protostream",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-remote/src/main/java/org/hibernate/ogm/datastore/infinispanremote/impl/protobuf/schema/SchemaDefinitions.java#L54-L78 | train |
JetBrains/xodus | compress/src/main/java/jetbrains/exodus/util/CompressBackupUtil.java | CompressBackupUtil.archiveFile | public static void archiveFile(@NotNull final ArchiveOutputStream out,
@NotNull final VirtualFileDescriptor source,
final long fileSize) throws IOException {
if (!source.hasContent()) {
throw new IllegalArgumentException("Provided... | java | public static void archiveFile(@NotNull final ArchiveOutputStream out,
@NotNull final VirtualFileDescriptor source,
final long fileSize) throws IOException {
if (!source.hasContent()) {
throw new IllegalArgumentException("Provided... | [
"public",
"static",
"void",
"archiveFile",
"(",
"@",
"NotNull",
"final",
"ArchiveOutputStream",
"out",
",",
"@",
"NotNull",
"final",
"VirtualFileDescriptor",
"source",
",",
"final",
"long",
"fileSize",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"source",... | Adds the file to the tar archive represented by output stream. It's caller's responsibility to close output stream
properly.
@param out target archive.
@param source file to be added.
@param fileSize size of the file (which is known in most cases).
@throws IOException in case of any issues with underlying store... | [
"Adds",
"the",
"file",
"to",
"the",
"tar",
"archive",
"represented",
"by",
"output",
"stream",
".",
"It",
"s",
"caller",
"s",
"responsibility",
"to",
"close",
"output",
"stream",
"properly",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/compress/src/main/java/jetbrains/exodus/util/CompressBackupUtil.java#L226-L255 | train |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/tree/patricia/MutableNode.java | MutableNode.setRightChild | void setRightChild(final byte b, @NotNull final MutableNode child) {
final ChildReference right = children.getRight();
if (right == null || (right.firstByte & 0xff) != (b & 0xff)) {
throw new IllegalArgumentException();
}
children.setAt(children.size() - 1, new ChildReference... | java | void setRightChild(final byte b, @NotNull final MutableNode child) {
final ChildReference right = children.getRight();
if (right == null || (right.firstByte & 0xff) != (b & 0xff)) {
throw new IllegalArgumentException();
}
children.setAt(children.size() - 1, new ChildReference... | [
"void",
"setRightChild",
"(",
"final",
"byte",
"b",
",",
"@",
"NotNull",
"final",
"MutableNode",
"child",
")",
"{",
"final",
"ChildReference",
"right",
"=",
"children",
".",
"getRight",
"(",
")",
";",
"if",
"(",
"right",
"==",
"null",
"||",
"(",
"right",... | Sets in-place the right child with the same first byte.
@param b next byte of child suffix.
@param child child node. | [
"Sets",
"in",
"-",
"place",
"the",
"right",
"child",
"with",
"the",
"same",
"first",
"byte",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/tree/patricia/MutableNode.java#L190-L196 | train |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/tree/btree/BTreeBalancePolicy.java | BTreeBalancePolicy.needMerge | public boolean needMerge(@NotNull final BasePage left, @NotNull final BasePage right) {
final int leftSize = left.getSize();
final int rightSize = right.getSize();
return leftSize == 0 || rightSize == 0 ||
leftSize + rightSize <= (((isDupTree(left) ? getDupPageMaxSize() : getPageMaxS... | java | public boolean needMerge(@NotNull final BasePage left, @NotNull final BasePage right) {
final int leftSize = left.getSize();
final int rightSize = right.getSize();
return leftSize == 0 || rightSize == 0 ||
leftSize + rightSize <= (((isDupTree(left) ? getDupPageMaxSize() : getPageMaxS... | [
"public",
"boolean",
"needMerge",
"(",
"@",
"NotNull",
"final",
"BasePage",
"left",
",",
"@",
"NotNull",
"final",
"BasePage",
"right",
")",
"{",
"final",
"int",
"leftSize",
"=",
"left",
".",
"getSize",
"(",
")",
";",
"final",
"int",
"rightSize",
"=",
"ri... | Is invoked on the leaf deletion only.
@param left left page.
@param right right page.
@return true if the left page ought to be merged with the right one. | [
"Is",
"invoked",
"on",
"the",
"leaf",
"deletion",
"only",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/tree/btree/BTreeBalancePolicy.java#L70-L75 | train |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/env/MetaTreeImpl.java | MetaTreeImpl.saveMetaTree | @NotNull
static MetaTreeImpl.Proto saveMetaTree(@NotNull final ITreeMutable metaTree,
@NotNull final EnvironmentImpl env,
@NotNull final ExpiredLoggableCollection expired) {
final long newMetaTreeAddress = metaTree.save();... | java | @NotNull
static MetaTreeImpl.Proto saveMetaTree(@NotNull final ITreeMutable metaTree,
@NotNull final EnvironmentImpl env,
@NotNull final ExpiredLoggableCollection expired) {
final long newMetaTreeAddress = metaTree.save();... | [
"@",
"NotNull",
"static",
"MetaTreeImpl",
".",
"Proto",
"saveMetaTree",
"(",
"@",
"NotNull",
"final",
"ITreeMutable",
"metaTree",
",",
"@",
"NotNull",
"final",
"EnvironmentImpl",
"env",
",",
"@",
"NotNull",
"final",
"ExpiredLoggableCollection",
"expired",
")",
"{"... | Saves meta tree, writes database root and flushes the log.
@param metaTree mutable meta tree
@param env enclosing environment
@param expired expired loggables (database root to be added)
@return database root loggable which is read again from the log. | [
"Saves",
"meta",
"tree",
"writes",
"database",
"root",
"and",
"flushes",
"the",
"log",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/env/MetaTreeImpl.java#L180-L191 | train |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java | PersistentEntityStoreImpl.clearProperties | @SuppressWarnings({"OverlyLongMethod"})
public void clearProperties(@NotNull final PersistentStoreTransaction txn, @NotNull final Entity entity) {
final Transaction envTxn = txn.getEnvironmentTransaction();
final PersistentEntityId id = (PersistentEntityId) entity.getId();
final int entityTy... | java | @SuppressWarnings({"OverlyLongMethod"})
public void clearProperties(@NotNull final PersistentStoreTransaction txn, @NotNull final Entity entity) {
final Transaction envTxn = txn.getEnvironmentTransaction();
final PersistentEntityId id = (PersistentEntityId) entity.getId();
final int entityTy... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"OverlyLongMethod\"",
"}",
")",
"public",
"void",
"clearProperties",
"(",
"@",
"NotNull",
"final",
"PersistentStoreTransaction",
"txn",
",",
"@",
"NotNull",
"final",
"Entity",
"entity",
")",
"{",
"final",
"Transaction",
"envTxn... | Clears all properties of specified entity.
@param entity to clear. | [
"Clears",
"all",
"properties",
"of",
"specified",
"entity",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java#L967-L990 | train |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java | PersistentEntityStoreImpl.deleteEntity | boolean deleteEntity(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity) {
clearProperties(txn, entity);
clearBlobs(txn, entity);
deleteLinks(txn, entity);
final PersistentEntityId id = entity.getId();
final int entityTypeId = id.getTypeId();
... | java | boolean deleteEntity(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity) {
clearProperties(txn, entity);
clearBlobs(txn, entity);
deleteLinks(txn, entity);
final PersistentEntityId id = entity.getId();
final int entityTypeId = id.getTypeId();
... | [
"boolean",
"deleteEntity",
"(",
"@",
"NotNull",
"final",
"PersistentStoreTransaction",
"txn",
",",
"@",
"NotNull",
"final",
"PersistentEntity",
"entity",
")",
"{",
"clearProperties",
"(",
"txn",
",",
"entity",
")",
";",
"clearBlobs",
"(",
"txn",
",",
"entity",
... | Deletes specified entity clearing all its properties and deleting all its outgoing links.
@param entity to delete. | [
"Deletes",
"specified",
"entity",
"clearing",
"all",
"its",
"properties",
"and",
"deleting",
"all",
"its",
"outgoing",
"links",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java#L1510-L1536 | train |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java | PersistentEntityStoreImpl.deleteLinks | private void deleteLinks(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity) {
final PersistentEntityId id = entity.getId();
final int entityTypeId = id.getTypeId();
final long entityLocalId = id.getLocalId();
final Transaction envTxn = txn.getEnvironme... | java | private void deleteLinks(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity) {
final PersistentEntityId id = entity.getId();
final int entityTypeId = id.getTypeId();
final long entityLocalId = id.getLocalId();
final Transaction envTxn = txn.getEnvironme... | [
"private",
"void",
"deleteLinks",
"(",
"@",
"NotNull",
"final",
"PersistentStoreTransaction",
"txn",
",",
"@",
"NotNull",
"final",
"PersistentEntity",
"entity",
")",
"{",
"final",
"PersistentEntityId",
"id",
"=",
"entity",
".",
"getId",
"(",
")",
";",
"final",
... | Deletes all outgoing links of specified entity.
@param entity the entity. | [
"Deletes",
"all",
"outgoing",
"links",
"of",
"specified",
"entity",
"."
] | 7b3476c4e81db66f9c7529148c761605cc8eea6d | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java#L1543-L1572 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.