This file contains hidden or 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
Usuario.where('login in (?)', ['a', 'b', 'c']).update_all( status: :bloqueado ) |
This file contains hidden or 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
Usuario.where('login in (?)', ['a', 'b', 'c']).each do|u| | |
u.update_attribute :status, :bloqueado | |
end |
This file contains hidden or 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
class Picapau | |
def voa | |
p 'estou voando' | |
end | |
end | |
woody = Picapau.new | |
amigo = Picapau.new | |
woody.voa # => estou voando |
This file contains hidden or 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
@AnyMetaDef(idType = "long", metaType = "long", metaValues = { | |
@MetaValue(value = "1", targetEntity = Restaurante.class), | |
@MetaValue(value = "2", targetEntity = Prato.class) }) |
This file contains hidden or 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
@AnyMetaDef(idType = "long", metaType = "string", metaValues = { | |
@MetaValue(value = "RESTAURANTE", targetEntity = Restaurante.class), | |
@MetaValue(value = "PRATO", targetEntity = Prato.class) }) |
This file contains hidden or 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
@Entity | |
public class Comentario { | |
@Id | |
@GeneratedValue | |
private long id; | |
private String comentario; | |
@Any(metaColumn = @Column(name = "detail_type")) | |
@AnyMetaDef(idType = "long", metaType = "string", metaValues = { |
This file contains hidden or 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
@Entity | |
@SequenceGenerator(name = "Entidade_Seq") | |
public class Entidade { | |
@Id | |
@GeneratedValue(generator = "Entidade_Seq", strategy = GenerationType.AUTO) | |
private int id; | |
} |
This file contains hidden or 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
@Entity | |
public class Entidade{ | |
@Id | |
@GeneratedValue | |
private int id; | |
} |
This file contains hidden or 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
private test() { | |
System.out.println("two"); | |
} |
This file contains hidden or 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
private test() { | |
{ | |
System.out.println("two"); | |
} | |
} |
NewerOlder