Skip to content

Commit

Permalink
Add Table attribute to generated class
Browse files Browse the repository at this point in the history
Updated the code to include a Table attribute annotation before the class declaration. This change ensures that the generated class is properly mapped to the database table.
  • Loading branch information
Nils Kleinert committed Oct 19, 2024
1 parent a97d11a commit 8dc6da4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ program
});

const className = table.charAt(0).toUpperCase() + table.slice(1).toLowerCase();
const output = [`public class ${className} {`];
const output = [`[Table("${table}")]\npublic class ${className} {`];
fields.forEach((element) => {
output.push(` public ${element.fieldType} ${element.fieldName.charAt(0).toUpperCase() + element.fieldName.slice(1)} { get; set; }`);
});
Expand Down

0 comments on commit 8dc6da4

Please sign in to comment.