Created
November 13, 2012 16:19
-
-
Save oinume/4066726 to your computer and use it in GitHub Desktop.
FreeMarkerで余計な改行が入ってしまうftl例(最初の段階)
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
package ${packageName}; | |
import javax.persistence.Column; | |
import javax.persistence.Entity; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.GenerationType; | |
import javax.persistence.Id; | |
import javax.persistence.Table; | |
@Entity | |
@Table(name = "${name}") | |
public class ${javaType} { | |
<#list columns as c> | |
<#if c.isId()>@Id</#if> // (1)ifにマッチしない場合、ここに余計な改行が入る | |
<#if c.isAutoIncrement()>@GeneratedValue(strategy = GenerationType.IDENTITY)</#if> // (2)ここも同様 | |
@Column(name = "${c.name}", unique = ${c.isUnique()?string}) | |
private ${c.javaType} ${c.javaName}; // TODO: default value | |
</#list> | |
// Getter/Setter | |
<#list columns as c> | |
public ${c.javaType} get${c.javaMethodName}() { | |
return ${c.javaName}; | |
} | |
public void set${c.javaMethodName}() { | |
this.${c.javaName} = ${c.javaName}; | |
} | |
</#list> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment