<commit_before>package fr.openwide.core.jpa.util;

import org.hibernate.cfg.DefaultComponentSafeNamingStrategy;

/**
 * Fixes bug <a href="https://hibernate.onjira.com/browse/HHH-6005">HHH-6005</a> in {@link DefaultComponentSafeNamingStrategy}.
 */
public class FixedDefaultComponentSafeNamingStrategy extends DefaultComponentSafeNamingStrategy {

	private static final long serialVersionUID = -2382165043375385406L;

	@Override
	public String propertyToColumnName(String propertyName) {
		return super.propertyToColumnName(propertyName.replace(".collection&&element.", "."));
	}

}<commit_msg>FixedDefaultComponentSafeNamingStrategy : application du bugfix partout où c'est nécessaire.<commit_after>package fr.openwide.core.jpa.util;

import org.hibernate.cfg.DefaultComponentSafeNamingStrategy;

/**
 * Fixes bug <a href="https://hibernate.onjira.com/browse/HHH-6005">HHH-6005</a> in {@link DefaultComponentSafeNamingStrategy}.
 */
public class FixedDefaultComponentSafeNamingStrategy extends DefaultComponentSafeNamingStrategy {

	private static final long serialVersionUID = -2382165043375385406L;
	
	protected static String fixPropertyName(String propertyName) {
		return propertyName.replace(".collection&&element.", ".");
	}

	@Override
	public String propertyToColumnName(String propertyName) {
		return super.propertyToColumnName(fixPropertyName(propertyName));
	}
	
	@Override
	public String collectionTableName(String ownerEntity, String ownerEntityTable, String associatedEntity,
			String associatedEntityTable, String propertyName) {
		return super.collectionTableName(ownerEntity, ownerEntityTable, associatedEntity, associatedEntityTable,
				fixPropertyName(propertyName));
	}
	
	@Override
	public String foreignKeyColumnName(String propertyName, String propertyEntityName, String propertyTableName,
			String referencedColumnName) {
		return super.foreignKeyColumnName(fixPropertyName(propertyName),
				propertyEntityName, propertyTableName, referencedColumnName);
	}

}
{'fraction_non_alphanumeric': 0.08949220713926596, 'fraction_numerical': 0.027149321266968326, 'mean_word_length': 7.155737704918033, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5331883', 'n_tokens_mistral': 603, 'n_tokens_neox': 531, 'n_words': 107}