-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#89] fix: hibernate 6에 맞춰서 PhysicalNamingStrategyStandardImpl 네이밍 전략…
…이 되도록 수정
- Loading branch information
Showing
2 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
main/src/main/java/org/sopt/makers/crew/main/common/config/CamelCaseNamingStrategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.sopt.makers.crew.main.common.config; | ||
|
||
import org.hibernate.boot.model.naming.Identifier; | ||
import org.hibernate.boot.model.naming.PhysicalNamingStrategy; | ||
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment; | ||
|
||
public class CamelCaseNamingStrategy implements PhysicalNamingStrategy { | ||
|
||
@Override | ||
public Identifier toPhysicalCatalogName(Identifier name, JdbcEnvironment jdbcEnvironment) { | ||
return apply(name, jdbcEnvironment); | ||
} | ||
|
||
@Override | ||
public Identifier toPhysicalSchemaName(Identifier name, JdbcEnvironment jdbcEnvironment) { | ||
return apply(name, jdbcEnvironment); | ||
} | ||
|
||
@Override | ||
public Identifier toPhysicalTableName(Identifier name, JdbcEnvironment jdbcEnvironment) { | ||
return apply(name, jdbcEnvironment); | ||
} | ||
|
||
@Override | ||
public Identifier toPhysicalSequenceName(Identifier name, JdbcEnvironment jdbcEnvironment) { | ||
return apply(name, jdbcEnvironment); | ||
} | ||
|
||
@Override | ||
public Identifier toPhysicalColumnName(Identifier name, JdbcEnvironment jdbcEnvironment) { | ||
return apply(name, jdbcEnvironment); | ||
} | ||
|
||
private Identifier apply(Identifier identifier, JdbcEnvironment jdbcEnvironment) { | ||
if (identifier == null) { | ||
return null; | ||
} | ||
return Identifier.toIdentifier(identifier.getText(), true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters