-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HBX-2880: Create and use subclasses for BasicValue and Component to a…
…ccommodate for changes in identity generation Signed-off-by: Koen Aers <koen.aers@gmail.com>
- Loading branch information
Showing
8 changed files
with
139 additions
and
23 deletions.
There are no files selected for viewing
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
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
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
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
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
40 changes: 40 additions & 0 deletions
40
orm/src/main/java/org/hibernate/tool/internal/reveng/util/EnhancedBasicValue.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.hibernate.tool.internal.reveng.util; | ||
|
||
import java.util.Properties; | ||
|
||
import org.hibernate.boot.spi.MetadataBuildingContext; | ||
import org.hibernate.mapping.BasicValue; | ||
import org.hibernate.mapping.Table; | ||
|
||
@SuppressWarnings("serial") | ||
public class EnhancedBasicValue extends BasicValue implements EnhancedValue { | ||
|
||
private Properties idGenProps = new Properties(); | ||
private String genStrategy = null; | ||
|
||
public EnhancedBasicValue(MetadataBuildingContext buildingContext, Table table) { | ||
super(buildingContext, table); | ||
} | ||
|
||
@Override | ||
public void setIdentifierGeneratorProperties(Properties props) { | ||
idGenProps = props; | ||
|
||
} | ||
|
||
@Override | ||
public Properties getIdentifierGeneratorProperties() { | ||
return idGenProps; | ||
} | ||
|
||
@Override | ||
public void setIdentifierGeneratorStrategy(String s) { | ||
genStrategy = s; | ||
} | ||
|
||
@Override | ||
public String getIdentifierGeneratorStrategy() { | ||
return genStrategy; | ||
} | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
orm/src/main/java/org/hibernate/tool/internal/reveng/util/EnhancedComponent.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,41 @@ | ||
package org.hibernate.tool.internal.reveng.util; | ||
|
||
import java.util.Properties; | ||
|
||
import org.hibernate.MappingException; | ||
import org.hibernate.boot.spi.MetadataBuildingContext; | ||
import org.hibernate.mapping.Component; | ||
import org.hibernate.mapping.PersistentClass; | ||
|
||
@SuppressWarnings("serial") | ||
public class EnhancedComponent extends Component implements EnhancedValue { | ||
|
||
private Properties idGenProps = new Properties(); | ||
private String genStrategy = null; | ||
|
||
public EnhancedComponent(MetadataBuildingContext metadata, PersistentClass owner) throws MappingException { | ||
super(metadata, owner); | ||
} | ||
|
||
@Override | ||
public void setIdentifierGeneratorProperties(Properties props) { | ||
idGenProps = props; | ||
|
||
} | ||
|
||
@Override | ||
public Properties getIdentifierGeneratorProperties() { | ||
return idGenProps; | ||
} | ||
|
||
@Override | ||
public void setIdentifierGeneratorStrategy(String s) { | ||
genStrategy = s; | ||
} | ||
|
||
@Override | ||
public String getIdentifierGeneratorStrategy() { | ||
return genStrategy; | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
orm/src/main/java/org/hibernate/tool/internal/reveng/util/EnhancedValue.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,17 @@ | ||
package org.hibernate.tool.internal.reveng.util; | ||
|
||
import java.util.Properties; | ||
|
||
import org.hibernate.mapping.KeyValue; | ||
|
||
public interface EnhancedValue extends KeyValue { | ||
|
||
void setIdentifierGeneratorProperties(Properties suggestedProperties); | ||
|
||
Properties getIdentifierGeneratorProperties(); | ||
|
||
void setIdentifierGeneratorStrategy(String s); | ||
|
||
String getIdentifierGeneratorStrategy(); | ||
|
||
} |