OracleOrmLiteDialectProvider sets default sequence names (e.g. for autogenerated id values) to modelName + "_" + fieldName + "_GEN":
Excerpt from OracleOrmLiteDialectProvider.Sequence:
var seqName = NamingStrategy.ApplyNameRestrictions(modelName + "_" + fieldName + "_GEN");
I am dealing with a legacy system (tables and corresponding sequences already exist) which uses a different pattern: "SEQ_AUTO_".
Is there any easy way to influence the sequence name generation? I am currently using the sequence attribute on each of my DTOs. (Unfortunately, the OracleOrmLiteDialectProvider.Sequence methode is private.)
The Sequence Name strategy has now been moved to INamingStrategy in this commit.
This now lets you use your own custom Naming Strategy for sequences, e.g:
public class MyOracleNamingStrategy : OracleNamingStrategy
{
public override string GetSequenceName(string table, string field)
{
var seqName = ApplyNameRestrictions("SEQ_AUTO_" + table + "_" + field);
return seqName;
}
}
Which you can register to use in your Oracle Provider with:
OrmLiteConfig.DialectProvider = new OracleOrmLiteDialectProvider {
NamingStrategy = new MyOracleNamingStrategy()
};
This is available from v4.0.31+ which is now available on MyGet.