Using LLBLGen 5.6.1
Adapter.
Database-first development
My team has a SQL Server database with a table called OrganizationalUnitPrivilege:
CREATE TABLE [PT].[OrganizationalUnitPrivilege](
[ID] [int] IDENTITY(1,1) NOT NULL,
[PrivilegeCode] [varchar](255) NOT NULL,
[PrivilegeLevelGrantedCode] [varchar](16) NULL,
[OrganizationalUnitID] [int] NOT NULL,
[UpdateById] [int] NULL,
[CreateById] [int] NULL,
[UpdateTime] [dbo].[UpdateTime] NULL,
[CreateTime] [dbo].[CreateTime] NULL,
[RowVersion] [timestamp] NOT NULL,
CONSTRAINT [PK_OrganizationalUnitPrivilege] PRIMARY KEY CLUSTERED
(
[ID] ASC
),
CONSTRAINT [IX_OrganizationalUnitPrivilege_UniqueKey1] UNIQUE NONCLUSTERED
(
[PrivilegeCode] ASC,
[OrganizationalUnitID] ASC
)
)
When we generate the code, it makes OrganizationalUnitPrivilegeEntity.ConstructFilterForUCPrivilegeCodeOrganizationalUnitId().
I assumed the name of the filter listed the field names in the same order as they were listed in the unique key constraint definition in the database.
Postgresql version
We have another team porting our project to use Postgresql.
In their postgresql database, they also have a unique key constraint with the fields listed in PrivilegeCode, OrganizationalUnitId order (unfortunately, I don't have the script to show you that).
But when they generate code, it names the filter function: OrganizationalUnitPrivilegeEntity.ConstructFilterForUCOrganizationalUnitIdPrivilegeCode().
It switched the fields in the filter function name!
So now they have to change our programs that used to call ConstructFilterForUCPrivilegeCodeOrganizationalUnitId() to call ConstructFilterForUCOrganizationalUnitIdPrivilegeCode() instead which is kind of annoying.
Testing if UC field order affects filter method name
I also did a test to see if the order of the fields in the unique key constraint definition in the database affects the generated name.
So, I removed the UC from the database.
Re-synced the model and database.
Re-generated the code.
The OrganizationalUnitPrivilegeEntity.ConstructFilterForUCPrivilegeCodeOrganizationalUnitId() was now gone. Which is correct.
Then I re-added the UC in the database, but changed the order of the fields in the UC definition to be: OrganizationalUnitId, PrivilegeCode.
Re-synced the model and database.
Re-generated the code.
It created OrganizationalUnitPrivilegeEntity.ConstructFilterForUCPrivilegeCodeOrganizationalUnitId().
So changing the order of fields in the UC definition in the database did NOT change the order of the fields in the name of the filter function.
So, how does LLBLGen generate the ConstructFilterForUCxxx() name?