Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SecondaryId conversion #3317

Merged
merged 7 commits into from
Mar 6, 2024

Conversation

jnsrnhld
Copy link
Collaborator

No description provided.

* selects the right column for the given secondaryId from a table
*/
@CheckForNull
private Column findSecondaryIdColumn(Table table) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Den Teil hier habe ich in die Table Klasse verschoben und public gemacht, damit ich bei der Conversion auch darauf zugreifen kann.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplizierte ungenutzte Klasse.

@jnsrnhld jnsrnhld requested a review from awildturtok February 28, 2024 15:07
Copy link
Collaborator

@awildturtok awildturtok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Für die tests hab ich gerade leider keinen Kopf, Code ist ja aber im Grunde nur durchhangeln der SelectsIds. (sind nur +~80 Zeilen Code wenn man die Tests ignoriert 🔥 )

import org.jooq.Field;
import org.jooq.impl.DSL;

public class SelectsIds implements Qualifiable<SelectsIds> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

der Name ist etwas merkwürdig, sit das ein Typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meine Herleitung war: das sind die IDs für die Selects Klasse, also hab ich SelectsIds draus gemacht.
Du meinst Typo im Sinne dass es SelectIds heißen sollte?
Ansonsten würde ich anbieten:

  • SqlIds
  • SqlIdColumns

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glaube SqlIdColumns gefällt mir am besten.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@awildturtok Mir auch, hab die Klasse umbenannt. Ist sonst noch was offen?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

die Tests hast du aus den legacy tests kopiert oder? Wenn ja dann passt. Sonst würde ich nochmal drüber gehen.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genau, sind 1 zu 1 übernommen, außer dass ich DATE_RANGE validity dates in start und end DATE column umgewandelt hab, sodass es für beide Dialekte passt.

joinSecondariesCondition = leftIds.getSecondaryId().get().eq(rightIds.getSecondaryId().get());
}
else {
joinSecondariesCondition = DSL.noCondition();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invert und early return?

@jnsrnhld jnsrnhld enabled auto-merge (squash) March 6, 2024 09:55
@jnsrnhld jnsrnhld merged commit f4f337c into develop Mar 6, 2024
6 checks passed
@delete-merged-branch delete-merged-branch bot deleted the sql/feature/secondary-id-conversion branch March 6, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants